@forgeax/engine-render 0.1.20 → 0.1.23

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 (645) hide show
  1. package/README.md +365 -29
  2. package/dist/assembly/backend-contract.d.ts +13 -0
  3. package/dist/assembly/backend-contract.d.ts.map +1 -1
  4. package/dist/assembly/device-feature-admission.d.ts +18 -0
  5. package/dist/assembly/device-feature-admission.d.ts.map +1 -0
  6. package/dist/assembly/directional-shadow-inspection.d.ts +38 -0
  7. package/dist/assembly/directional-shadow-inspection.d.ts.map +1 -0
  8. package/dist/assembly/factory.d.ts +30 -19
  9. package/dist/assembly/factory.d.ts.map +1 -1
  10. package/dist/assembly/host-contract.d.ts +19 -0
  11. package/dist/assembly/host-contract.d.ts.map +1 -1
  12. package/dist/assembly/render-target-host.d.ts +46 -0
  13. package/dist/assembly/render-target-host.d.ts.map +1 -0
  14. package/dist/assets/render-asset-port.d.ts.map +1 -1
  15. package/dist/authoring.mjs +4 -1
  16. package/dist/authoring.mjs.map +1 -1
  17. package/dist/capture/cube-views.d.ts +21 -0
  18. package/dist/capture/cube-views.d.ts.map +1 -0
  19. package/dist/capture/scheduler.d.ts +54 -0
  20. package/dist/capture/scheduler.d.ts.map +1 -0
  21. package/dist/{chunk-PCHBPYML.mjs → chunk-4L3P6DT5.mjs} +2 -2
  22. package/dist/chunk-4L3P6DT5.mjs.map +1 -0
  23. package/dist/{chunk-VFPLTKCU.mjs → chunk-4NPUASZR.mjs} +15 -4
  24. package/dist/chunk-4NPUASZR.mjs.map +1 -0
  25. package/dist/chunk-DIYW3M5D.mjs +5085 -0
  26. package/dist/chunk-DIYW3M5D.mjs.map +1 -0
  27. package/dist/chunk-FBC4R44J.mjs +1003 -0
  28. package/dist/chunk-FBC4R44J.mjs.map +1 -0
  29. package/dist/{chunk-CDTWTHZR.mjs → chunk-FF7K3FSO.mjs} +474 -168
  30. package/dist/chunk-FF7K3FSO.mjs.map +1 -0
  31. package/dist/chunk-HZUPSYW7.mjs +1104 -0
  32. package/dist/chunk-HZUPSYW7.mjs.map +1 -0
  33. package/dist/{chunk-TBQJOK2L.mjs → chunk-QODA5UKU.mjs} +321 -269
  34. package/dist/chunk-QODA5UKU.mjs.map +1 -0
  35. package/dist/chunk-YALPS44A.mjs +296 -0
  36. package/dist/chunk-YALPS44A.mjs.map +1 -0
  37. package/dist/{chunk-4XINDLAY.mjs → chunk-ZUWKAZ2I.mjs} +1963 -2178
  38. package/dist/chunk-ZUWKAZ2I.mjs.map +1 -0
  39. package/dist/cluster-binner.d.ts +5 -0
  40. package/dist/cluster-binner.d.ts.map +1 -1
  41. package/dist/components/camera.d.ts +1 -0
  42. package/dist/components/camera.d.ts.map +1 -1
  43. package/dist/components/cube-camera.d.ts +20 -0
  44. package/dist/components/cube-camera.d.ts.map +1 -0
  45. package/dist/components/directional-light.d.ts +11 -2
  46. package/dist/components/directional-light.d.ts.map +1 -1
  47. package/dist/components/directional-shadow-filter.d.ts +25 -0
  48. package/dist/components/directional-shadow-filter.d.ts.map +1 -0
  49. package/dist/components/index.d.ts +5 -0
  50. package/dist/components/index.d.ts.map +1 -1
  51. package/dist/components/light-helpers.d.ts +4 -0
  52. package/dist/components/light-helpers.d.ts.map +1 -1
  53. package/dist/components/light-probe.d.ts +9 -0
  54. package/dist/components/light-probe.d.ts.map +1 -0
  55. package/dist/components/rect-area-light.d.ts +12 -0
  56. package/dist/components/rect-area-light.d.ts.map +1 -0
  57. package/dist/components/reflection-probe.d.ts +17 -0
  58. package/dist/components/reflection-probe.d.ts.map +1 -0
  59. package/dist/components/scene-instance.d.ts +4 -0
  60. package/dist/components/scene-instance.d.ts.map +1 -1
  61. package/dist/components/spot-light.d.ts +3 -0
  62. package/dist/components/spot-light.d.ts.map +1 -1
  63. package/dist/construct-renderer.mjs +14836 -9620
  64. package/dist/construct-renderer.mjs.map +1 -1
  65. package/dist/device/gpu-residency.d.ts +8 -1
  66. package/dist/device/gpu-residency.d.ts.map +1 -1
  67. package/dist/device/lifecycle-transaction.d.ts +2 -0
  68. package/dist/device/lifecycle-transaction.d.ts.map +1 -0
  69. package/dist/environment/frame.d.ts.map +1 -1
  70. package/dist/environment/lifecycle.d.ts +5 -0
  71. package/dist/environment/lifecycle.d.ts.map +1 -1
  72. package/dist/errors/gpu-driven.d.ts +26 -0
  73. package/dist/errors/gpu-driven.d.ts.map +1 -0
  74. package/dist/errors/index.d.ts +1 -0
  75. package/dist/errors/index.d.ts.map +1 -1
  76. package/dist/errors/recover.d.ts +9 -1
  77. package/dist/errors/recover.d.ts.map +1 -1
  78. package/dist/errors/render.d.ts +166 -93
  79. package/dist/errors/render.d.ts.map +1 -1
  80. package/dist/extract/directional-shadow-projection.d.ts +23 -0
  81. package/dist/extract/directional-shadow-projection.d.ts.map +1 -0
  82. package/dist/extract/environment.d.ts +14 -0
  83. package/dist/extract/environment.d.ts.map +1 -1
  84. package/dist/extract/gpu-driven.d.ts +50 -0
  85. package/dist/extract/gpu-driven.d.ts.map +1 -0
  86. package/dist/extract/visibility.d.ts.map +1 -1
  87. package/dist/features/fullscreen.d.ts.map +1 -1
  88. package/dist/features/targets.d.ts.map +1 -1
  89. package/dist/features/types.d.ts +10 -0
  90. package/dist/features/types.d.ts.map +1 -1
  91. package/dist/fullscreen-post-process-pass.d.ts +13 -2
  92. package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
  93. package/dist/gpu-driven/batch-topology.d.ts +34 -0
  94. package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
  95. package/dist/gpu-driven/prepared-draw.d.ts +63 -0
  96. package/dist/gpu-driven/prepared-draw.d.ts.map +1 -0
  97. package/dist/gpu-driven/production-raster.d.ts +97 -2
  98. package/dist/gpu-driven/production-raster.d.ts.map +1 -1
  99. package/dist/gpu-driven/view-gpu.d.ts +64 -1
  100. package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
  101. package/dist/gpu-scene-schema.d.ts +14 -0
  102. package/dist/gpu-scene-schema.d.ts.map +1 -1
  103. package/dist/gpu-scene.d.ts +8 -1
  104. package/dist/gpu-scene.d.ts.map +1 -1
  105. package/dist/gpu-usage.d.ts +0 -1
  106. package/dist/gpu-usage.d.ts.map +1 -1
  107. package/dist/hdrp-buffers.d.ts +21 -19
  108. package/dist/hdrp-buffers.d.ts.map +1 -1
  109. package/dist/ibl/IblPipelineCache.d.ts +4 -0
  110. package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
  111. package/dist/ibl/kernel-cache.d.ts +36 -0
  112. package/dist/ibl/kernel-cache.d.ts.map +1 -0
  113. package/dist/index.d.ts +39 -3
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.mjs +91 -6
  116. package/dist/index.mjs.map +1 -1
  117. package/dist/inspection-types.d.ts +214 -1
  118. package/dist/inspection-types.d.ts.map +1 -1
  119. package/dist/instances-derived-bounds.d.ts +50 -0
  120. package/dist/instances-derived-bounds.d.ts.map +1 -0
  121. package/dist/internal.d.ts +9 -0
  122. package/dist/internal.d.ts.map +1 -1
  123. package/dist/internal.mjs +23 -2
  124. package/dist/internal.mjs.map +1 -1
  125. package/dist/light-buffer-layout.d.ts +58 -140
  126. package/dist/light-buffer-layout.d.ts.map +1 -1
  127. package/dist/materials.d.ts.map +1 -1
  128. package/dist/mesh-material-bindings.d.ts +54 -0
  129. package/dist/mesh-material-bindings.d.ts.map +1 -1
  130. package/dist/pbr-pipeline.d.ts +38 -14
  131. package/dist/pbr-pipeline.d.ts.map +1 -1
  132. package/dist/pipeline/standard-forward-lane.d.ts +2 -1
  133. package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
  134. package/dist/pipeline/standard-lighting/errors.d.ts +4 -0
  135. package/dist/pipeline/standard-lighting/errors.d.ts.map +1 -0
  136. package/dist/pipeline/standard-lighting/graph.d.ts +24 -0
  137. package/dist/pipeline/standard-lighting/graph.d.ts.map +1 -0
  138. package/dist/pipeline/standard-lighting/inspection.d.ts +38 -0
  139. package/dist/pipeline/standard-lighting/inspection.d.ts.map +1 -0
  140. package/dist/pipeline/standard-lighting/layout.d.ts +28 -0
  141. package/dist/pipeline/standard-lighting/layout.d.ts.map +1 -0
  142. package/dist/pipeline/standard-lighting/light-frame.d.ts +33 -0
  143. package/dist/pipeline/standard-lighting/light-frame.d.ts.map +1 -0
  144. package/dist/pipeline/standard-lighting/membership.d.ts +14 -0
  145. package/dist/pipeline/standard-lighting/membership.d.ts.map +1 -0
  146. package/dist/pipeline/standard-lighting/prepare.d.ts +16 -0
  147. package/dist/pipeline/standard-lighting/prepare.d.ts.map +1 -0
  148. package/dist/pipeline/standard-lighting/topology.d.ts +45 -0
  149. package/dist/pipeline/standard-lighting/topology.d.ts.map +1 -0
  150. package/dist/pipeline/standard-lighting/transport.d.ts +36 -0
  151. package/dist/pipeline/standard-lighting/transport.d.ts.map +1 -0
  152. package/dist/pipeline/standard-pipeline.d.ts +4 -13
  153. package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
  154. package/dist/pipeline/standard-post.d.ts.map +1 -1
  155. package/dist/pipeline/standard-profile.d.ts +5 -26
  156. package/dist/pipeline/standard-profile.d.ts.map +1 -1
  157. package/dist/pipeline-builder.d.ts +2 -0
  158. package/dist/pipeline-builder.d.ts.map +1 -1
  159. package/dist/pipeline-spec.d.ts +40 -7
  160. package/dist/pipeline-spec.d.ts.map +1 -1
  161. package/dist/plugin.d.ts.map +1 -1
  162. package/dist/point-shadow-inspection.d.ts +21 -0
  163. package/dist/point-shadow-inspection.d.ts.map +1 -0
  164. package/dist/prepare/extended-lighting/ltc-resources.d.ts +31 -0
  165. package/dist/prepare/extended-lighting/ltc-resources.d.ts.map +1 -0
  166. package/dist/prepare/extended-lighting/resources.d.ts +72 -0
  167. package/dist/prepare/extended-lighting/resources.d.ts.map +1 -0
  168. package/dist/prepare/extended-lighting/spot-modifiers.d.ts +42 -0
  169. package/dist/prepare/extended-lighting/spot-modifiers.d.ts.map +1 -0
  170. package/dist/prepare/extended-lighting/state.d.ts +24 -0
  171. package/dist/prepare/extended-lighting/state.d.ts.map +1 -0
  172. package/dist/record/frame-lighting.d.ts +33 -36
  173. package/dist/record/frame-lighting.d.ts.map +1 -1
  174. package/dist/record/frame-snapshot.d.ts +78 -24
  175. package/dist/record/frame-snapshot.d.ts.map +1 -1
  176. package/dist/record/frame-targets.d.ts +5 -0
  177. package/dist/record/frame-targets.d.ts.map +1 -1
  178. package/dist/record/frame.d.ts +16 -6
  179. package/dist/record/frame.d.ts.map +1 -1
  180. package/dist/record/gpu-pass-timing/contract.d.ts +96 -0
  181. package/dist/record/gpu-pass-timing/contract.d.ts.map +1 -0
  182. package/dist/record/gpu-pass-timing/errors.d.ts +18 -0
  183. package/dist/record/gpu-pass-timing/errors.d.ts.map +1 -0
  184. package/dist/record/gpu-pass-timing/index.d.ts +8 -0
  185. package/dist/record/gpu-pass-timing/index.d.ts.map +1 -0
  186. package/dist/record/gpu-pass-timing/parser.d.ts +11 -0
  187. package/dist/record/gpu-pass-timing/parser.d.ts.map +1 -0
  188. package/dist/record/gpu-pass-timing/session.d.ts +43 -0
  189. package/dist/record/gpu-pass-timing/session.d.ts.map +1 -0
  190. package/dist/record/gpu-timing.d.ts +20 -3
  191. package/dist/record/gpu-timing.d.ts.map +1 -1
  192. package/dist/record/helpers.d.ts +0 -20
  193. package/dist/record/helpers.d.ts.map +1 -1
  194. package/dist/record/main-pass-geometry.d.ts +6 -1
  195. package/dist/record/main-pass-geometry.d.ts.map +1 -1
  196. package/dist/record/main-pass-material.d.ts +25 -2
  197. package/dist/record/main-pass-material.d.ts.map +1 -1
  198. package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
  199. package/dist/record/main-pass.d.ts +2 -0
  200. package/dist/record/main-pass.d.ts.map +1 -1
  201. package/dist/record/mesh-ssbo.d.ts.map +1 -1
  202. package/dist/record/render-context.d.ts +98 -6
  203. package/dist/record/render-context.d.ts.map +1 -1
  204. package/dist/record/shadow-pass.d.ts.map +1 -1
  205. package/dist/record/skybox-post-pass.d.ts.map +1 -1
  206. package/dist/record/typed-frame-graph.d.ts +119 -4
  207. package/dist/record/typed-frame-graph.d.ts.map +1 -1
  208. package/dist/record/view-ubo.d.ts +7 -5
  209. package/dist/record/view-ubo.d.ts.map +1 -1
  210. package/dist/reflection/filter.d.ts +22 -0
  211. package/dist/reflection/filter.d.ts.map +1 -0
  212. package/dist/reflection/gpu-table.d.ts +25 -0
  213. package/dist/reflection/gpu-table.d.ts.map +1 -0
  214. package/dist/reflection/inspection.d.ts +10 -0
  215. package/dist/reflection/inspection.d.ts.map +1 -0
  216. package/dist/reflection/projection.d.ts +140 -0
  217. package/dist/reflection/projection.d.ts.map +1 -0
  218. package/dist/reflection/record-owner.d.ts +60 -0
  219. package/dist/reflection/record-owner.d.ts.map +1 -0
  220. package/dist/render-contract.d.ts +62 -14
  221. package/dist/render-contract.d.ts.map +1 -1
  222. package/dist/render-graph-primitives.d.ts +1 -0
  223. package/dist/render-graph-primitives.d.ts.map +1 -1
  224. package/dist/render-pipeline.d.ts +49 -2
  225. package/dist/render-pipeline.d.ts.map +1 -1
  226. package/dist/render-system-extract.d.ts +160 -31
  227. package/dist/render-system-extract.d.ts.map +1 -1
  228. package/dist/render-system.d.ts +28 -2
  229. package/dist/render-system.d.ts.map +1 -1
  230. package/dist/renderer.d.ts +43 -0
  231. package/dist/renderer.d.ts.map +1 -0
  232. package/dist/scene/probe-blend-record.d.ts +22 -0
  233. package/dist/scene/probe-blend-record.d.ts.map +1 -0
  234. package/dist/scene/probe-blend.d.ts +142 -0
  235. package/dist/scene/probe-blend.d.ts.map +1 -0
  236. package/dist/scene/render-scene-types.d.ts +0 -6
  237. package/dist/scene/render-scene-types.d.ts.map +1 -1
  238. package/dist/scene/render-scene.d.ts +117 -9
  239. package/dist/scene/render-scene.d.ts.map +1 -1
  240. package/dist/scene/visibility/bounds.d.ts +20 -0
  241. package/dist/scene/visibility/bounds.d.ts.map +1 -0
  242. package/dist/scene/visibility/budget.d.ts +16 -0
  243. package/dist/scene/visibility/budget.d.ts.map +1 -0
  244. package/dist/scene/visibility/facet.d.ts +73 -0
  245. package/dist/scene/visibility/facet.d.ts.map +1 -0
  246. package/dist/scene/visibility/gpu-frame-timing.d.ts +41 -0
  247. package/dist/scene/visibility/gpu-frame-timing.d.ts.map +1 -0
  248. package/dist/scene/visibility/gpu-lod.d.ts +46 -0
  249. package/dist/scene/visibility/gpu-lod.d.ts.map +1 -0
  250. package/dist/scene/visibility/inspection.d.ts +132 -0
  251. package/dist/scene/visibility/inspection.d.ts.map +1 -0
  252. package/dist/scene/visibility/lod-selector.d.ts +25 -0
  253. package/dist/scene/visibility/lod-selector.d.ts.map +1 -0
  254. package/dist/scene/visibility/occlusion-confidence.d.ts +81 -0
  255. package/dist/scene/visibility/occlusion-confidence.d.ts.map +1 -0
  256. package/dist/scene/visibility/occlusion-pass.d.ts +57 -0
  257. package/dist/scene/visibility/occlusion-pass.d.ts.map +1 -0
  258. package/dist/scene/visibility/occlusion-query-pool.d.ts +57 -0
  259. package/dist/scene/visibility/occlusion-query-pool.d.ts.map +1 -0
  260. package/dist/scene/visibility/occlusion-runtime.d.ts +96 -0
  261. package/dist/scene/visibility/occlusion-runtime.d.ts.map +1 -0
  262. package/dist/scene/visibility/types.d.ts +34 -0
  263. package/dist/scene/visibility/types.d.ts.map +1 -0
  264. package/dist/shadow-atlas.d.ts +3 -3
  265. package/dist/shadow-atlas.d.ts.map +1 -1
  266. package/dist/ssao-buffers.d.ts +3 -0
  267. package/dist/ssao-buffers.d.ts.map +1 -1
  268. package/dist/ssr/admission.d.ts +122 -0
  269. package/dist/ssr/admission.d.ts.map +1 -0
  270. package/dist/ssr/composition.d.ts +32 -0
  271. package/dist/ssr/composition.d.ts.map +1 -0
  272. package/dist/ssr/errors.d.ts +39 -0
  273. package/dist/ssr/errors.d.ts.map +1 -0
  274. package/dist/ssr/identity.d.ts +13 -0
  275. package/dist/ssr/identity.d.ts.map +1 -0
  276. package/dist/systems/skin-palette-allocator.d.ts +1 -1
  277. package/dist/targets/contracts.d.ts +66 -0
  278. package/dist/targets/contracts.d.ts.map +1 -0
  279. package/dist/targets/graph-projection.d.ts +29 -0
  280. package/dist/targets/graph-projection.d.ts.map +1 -0
  281. package/dist/targets/material-source.d.ts +34 -0
  282. package/dist/targets/material-source.d.ts.map +1 -0
  283. package/dist/targets/owner.d.ts +32 -0
  284. package/dist/targets/owner.d.ts.map +1 -0
  285. package/dist/targets/physical.d.ts +18 -0
  286. package/dist/targets/physical.d.ts.map +1 -0
  287. package/dist/targets/readback.d.ts +39 -0
  288. package/dist/targets/readback.d.ts.map +1 -0
  289. package/dist/temporal/frame-coordinator.d.ts +13 -0
  290. package/dist/temporal/frame-coordinator.d.ts.map +1 -1
  291. package/dist/temporal/frame.d.ts +2 -0
  292. package/dist/temporal/frame.d.ts.map +1 -1
  293. package/dist/temporal/index.mjs +6 -5
  294. package/dist/temporal/view.d.ts +7 -0
  295. package/dist/temporal/view.d.ts.map +1 -1
  296. package/dist/tilemap-chunk-extract-system.d.ts +1 -1
  297. package/dist/typed-render-graph-primitives.d.ts +5 -1
  298. package/dist/typed-render-graph-primitives.d.ts.map +1 -1
  299. package/dist/typed-shadow-passes.d.ts +1 -1
  300. package/dist/typed-shadow-passes.d.ts.map +1 -1
  301. package/dist/volume/passes.d.ts +9 -5
  302. package/dist/volume/passes.d.ts.map +1 -1
  303. package/package.json +20 -20
  304. package/src/__tests__/bloom-exact-zero.unit.test.ts +48 -19
  305. package/src/__tests__/bloom-lifecycle.integration.test.ts +41 -13
  306. package/src/__tests__/camera-target-consumption.unit.test.ts +53 -0
  307. package/src/__tests__/cluster-binner.unit.test.ts +35 -0
  308. package/src/__tests__/cluster-grid-default-surface.unit.test.ts +12 -2
  309. package/src/__tests__/cube-camera-scheduler.unit.test.ts +70 -0
  310. package/src/__tests__/cube-camera-single-submit.perf.test.ts +75 -0
  311. package/src/__tests__/cube-camera-view-matrices.unit.test.ts +41 -0
  312. package/src/__tests__/cube-camera-vocabulary.unit.test.ts +47 -0
  313. package/src/__tests__/cube-camera.integration.test.ts +42 -0
  314. package/src/__tests__/detached-inspection.integration.test.ts +6 -0
  315. package/src/__tests__/device-feature-admission.unit.test.ts +85 -0
  316. package/src/__tests__/direct-light-snapshot.unit.test.ts +62 -6
  317. package/src/__tests__/docs-gate-green.unit.test.ts +38 -0
  318. package/src/__tests__/environment-generation.integration.test.ts +16 -0
  319. package/src/__tests__/evidence-identity.ts +13 -0
  320. package/src/__tests__/evidence-identity.unit.test.ts +24 -0
  321. package/src/__tests__/extended-lighting-recovery.browser.test.ts +14 -0
  322. package/src/__tests__/extended-lighting-recovery.dawn.test.ts +14 -0
  323. package/src/__tests__/extended-lighting-recovery.integration.test.ts +81 -0
  324. package/src/__tests__/extended-lighting-resources.unit.test.ts +51 -0
  325. package/src/__tests__/extended-lighting-zero-feature.integration.test.ts +52 -0
  326. package/src/__tests__/factory-contract.integration.test.ts +288 -29
  327. package/src/__tests__/fog-component.unit.test.ts +67 -0
  328. package/src/__tests__/fog.integration.test.ts +86 -0
  329. package/src/__tests__/frame-observation.contract.test.ts +15 -0
  330. package/src/__tests__/fullscreen-feature-plan.unit.test.ts +37 -0
  331. package/src/__tests__/gpu-driven-batch-topology-pbr.unit.test.ts +146 -0
  332. package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +10 -8
  333. package/src/__tests__/gpu-driven-indirect-raster.dawn.test.ts +18 -1
  334. package/src/__tests__/gpu-driven-production.integration.test.ts +579 -17
  335. package/src/__tests__/gpu-driven-scaling.unit.test.ts +66 -2
  336. package/src/__tests__/gpu-driven-view-gpu-evidence.ts +26 -1
  337. package/src/__tests__/gpu-driven-view-graph.integration.test.ts +101 -6
  338. package/src/__tests__/gpu-driven-view.browser.test.ts +3 -3
  339. package/src/__tests__/gpu-driven-view.dawn.test.ts +3 -3
  340. package/src/__tests__/gpu-driven-view.unit.test.ts +50 -0
  341. package/src/__tests__/gpu-lod-evidence.ts +188 -0
  342. package/src/__tests__/gpu-lod-fallback.integration.test.ts +10 -0
  343. package/src/__tests__/gpu-lod-indirect.integration.test.ts +40 -0
  344. package/src/__tests__/gpu-lod-parity.dawn.test.ts +29 -0
  345. package/src/__tests__/gpu-lod-readiness.integration.test.ts +52 -0
  346. package/src/__tests__/gpu-lod-schema.unit.test.ts +66 -0
  347. package/src/__tests__/gpu-lod-selector.unit.test.ts +28 -0
  348. package/src/__tests__/gpu-lod-silhouette.browser.test.ts +13 -0
  349. package/src/__tests__/gpu-pass-timing-browser-runner.ts +281 -0
  350. package/src/__tests__/gpu-pass-timing-coexistence.integration.test.ts +80 -0
  351. package/src/__tests__/gpu-pass-timing-contract.unit.test.ts +243 -0
  352. package/src/__tests__/gpu-pass-timing-exact-zero.unit.test.ts +131 -0
  353. package/src/__tests__/gpu-pass-timing-lifecycle.integration.test.ts +230 -0
  354. package/src/__tests__/gpu-pass-timing-observation.unit.test.ts +233 -0
  355. package/src/__tests__/gpu-pass-timing-session.unit.test.ts +438 -0
  356. package/src/__tests__/gpu-pass-timing.browser.test.ts +26 -0
  357. package/src/__tests__/gpu-pass-timing.rhi-null.unit.test.ts +125 -0
  358. package/src/__tests__/gpu-resource-store-stride.unit.test.ts +66 -1
  359. package/src/__tests__/gpu-scene.dawn.test.ts +8 -1
  360. package/src/__tests__/gpu-scene.unit.test.ts +49 -3
  361. package/src/__tests__/hdrp-group2-visibility.unit.test.ts +24 -0
  362. package/src/__tests__/instances-culling.integration.test.ts +94 -0
  363. package/src/__tests__/instances-derived-bounds.unit.test.ts +118 -0
  364. package/src/__tests__/light-buffer-layout.unit.test.ts +113 -3
  365. package/src/__tests__/light-inspection.unit.test.ts +55 -0
  366. package/src/__tests__/light-resource-error.unit.test.ts +43 -0
  367. package/src/__tests__/lighting-scene-roundtrip.integration.test.ts +109 -0
  368. package/src/__tests__/lod-bounds.unit.test.ts +42 -0
  369. package/src/__tests__/lod-cpu-lane.integration.test.ts +55 -0
  370. package/src/__tests__/lod-cpu-no-change.perf.test.ts +19 -0
  371. package/src/__tests__/lod-gpu-frame-timing.unit.test.ts +49 -0
  372. package/src/__tests__/lod-multi-view.integration.test.ts +63 -0
  373. package/src/__tests__/lod-occlusion-device-loss.integration.test.ts +27 -0
  374. package/src/__tests__/lod-occlusion-final-decision.integration.test.ts +47 -0
  375. package/src/__tests__/lod-occlusion-inspection.integration.test.ts +217 -0
  376. package/src/__tests__/lod-occlusion-inspection.schema.test-d.ts +14 -0
  377. package/src/__tests__/lod-occlusion-inspection.unit.test.ts +72 -0
  378. package/src/__tests__/lod-occlusion-visual-evidence.ts +91 -0
  379. package/src/__tests__/lod-occlusion.browser.test.ts +15 -0
  380. package/src/__tests__/lod-occlusion.dawn.test.ts +20 -0
  381. package/src/__tests__/lod-selector.profile.test.ts +35 -0
  382. package/src/__tests__/lod-selector.unit.test.ts +68 -0
  383. package/src/__tests__/lod-visibility-identity.unit.test.ts +198 -0
  384. package/src/__tests__/lod-visibility-lifecycle.integration.test.ts +132 -0
  385. package/src/__tests__/ltc-resources.unit.test.ts +32 -0
  386. package/src/__tests__/material-contract-inventory.unit.test.ts +17 -0
  387. package/src/__tests__/material-observation.integration.test.ts +101 -0
  388. package/src/__tests__/occlusion-confidence.unit.test.ts +168 -0
  389. package/src/__tests__/occlusion-invalidation.integration.test.ts +37 -0
  390. package/src/__tests__/occlusion-pass-routing.unit.test.ts +16 -0
  391. package/src/__tests__/occlusion-pass.dawn.test.ts +20 -0
  392. package/src/__tests__/occlusion-pass.integration.test.ts +43 -0
  393. package/src/__tests__/occlusion-pass.rhi-null.test.ts +22 -0
  394. package/src/__tests__/occlusion-query-pool.rhi-null.test.ts +21 -0
  395. package/src/__tests__/occlusion-query-pool.unit.test.ts +95 -0
  396. package/src/__tests__/occlusion-query-ticket.integration.test.ts +47 -0
  397. package/src/__tests__/occlusion-query.dawn.test.ts +16 -0
  398. package/src/__tests__/occlusion-query.evidence.ts +178 -0
  399. package/src/__tests__/occlusion-query.rhi-null.test.ts +31 -0
  400. package/src/__tests__/occlusion-runtime.unit.test.ts +120 -0
  401. package/src/__tests__/pbr-view-layout.unit.test.ts +16 -0
  402. package/src/__tests__/point-shadow-inspection.unit.test.ts +60 -0
  403. package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +196 -0
  404. package/src/__tests__/probe-bindings.unit.test.ts +200 -0
  405. package/src/__tests__/probe-blend-numeric.unit.test.ts +67 -0
  406. package/src/__tests__/probe-blend-oracle.unit.test.ts +136 -0
  407. package/src/__tests__/probe-capacity.integration.test.ts +97 -0
  408. package/src/__tests__/probe-recovery.integration.test.ts +104 -0
  409. package/src/__tests__/probe-scene-dirty.integration.test.ts +211 -0
  410. package/src/__tests__/profiler-phase-catalog.test.ts +4 -1
  411. package/src/__tests__/profiler-phase-token.test.ts +1 -0
  412. package/src/__tests__/public-surface.test-d.ts +10 -0
  413. package/src/__tests__/rect-area-boundary.unit.test.ts +24 -0
  414. package/src/__tests__/reflection-fallback-graph.unit.test.ts +67 -0
  415. package/src/__tests__/reflection-fallback-inspection.unit.test.ts +77 -0
  416. package/src/__tests__/reflection-fallback-lifecycle.integration.test.ts +21 -0
  417. package/src/__tests__/reflection-fallback-projection.unit.test.ts +90 -0
  418. package/src/__tests__/reflection-fallback-source.unit.test.ts +32 -0
  419. package/src/__tests__/reflection-probe-authoring.unit.test.ts +71 -0
  420. package/src/__tests__/reflection-probe-filter.unit.test.ts +54 -0
  421. package/src/__tests__/reflection-probe-ibl-topology.unit.test.ts +45 -0
  422. package/src/__tests__/reflection-probe-owner-placement.unit.test.ts +39 -0
  423. package/src/__tests__/reflection-probe-pass-encode.integration.test.ts +101 -0
  424. package/src/__tests__/reflection-probe-performance.perf.test.ts +60 -0
  425. package/src/__tests__/reflection-probe-record-owner.characterization.unit.test.ts +120 -0
  426. package/src/__tests__/reflection-probe-recovery.integration.test.ts +55 -0
  427. package/src/__tests__/reflection-probe-selection.unit.test.ts +46 -0
  428. package/src/__tests__/render-error-code-owner.test-d.ts +19 -3
  429. package/src/__tests__/render-feature-docs.unit.test.ts +12 -7
  430. package/src/__tests__/render-graph-fallback.integration.test.ts +24 -0
  431. package/src/__tests__/render-perf/extended-lighting.bench.test.ts +66 -0
  432. package/src/__tests__/render-scene-projection.unit.test.ts +447 -18
  433. package/src/__tests__/render-target-admission.unit.test.ts +80 -0
  434. package/src/__tests__/render-target-graph-projection.unit.test.ts +102 -0
  435. package/src/__tests__/render-target-inspection.unit.test.ts +52 -0
  436. package/src/__tests__/render-target-material-source.test-d.ts +30 -0
  437. package/src/__tests__/render-target-material-source.unit.test.ts +97 -0
  438. package/src/__tests__/render-target-owner-placement.unit.test.ts +203 -0
  439. package/src/__tests__/render-target-owner.unit.test.ts +122 -0
  440. package/src/__tests__/render-target-probe-soak.perf.test.ts +94 -0
  441. package/src/__tests__/render-target-public-schema.json +107 -0
  442. package/src/__tests__/render-target-public-schema.unit.test.ts +91 -0
  443. package/src/__tests__/render-target-public-surface.test-d.ts +83 -0
  444. package/src/__tests__/render-target-readback.integration.test.ts +90 -0
  445. package/src/__tests__/render-target-recovery.integration.test.ts +85 -0
  446. package/src/__tests__/renderer-factory-material-contract.unit.test.ts +124 -0
  447. package/src/__tests__/renderer-lifecycle.integration.test.ts +14 -0
  448. package/src/__tests__/shader-stage-surface.unit.test.ts +19 -4
  449. package/src/__tests__/skin-motion-regression.unit.test.ts +154 -0
  450. package/src/__tests__/skinned-shadow-caster.test.ts +13 -4
  451. package/src/__tests__/spot-modifier-projection.unit.test.ts +70 -0
  452. package/src/__tests__/ssr-admission-matrix.integration.test.ts +206 -0
  453. package/src/__tests__/ssr-composition.unit.test.ts +46 -0
  454. package/src/__tests__/ssr-fallback-zero-work.bench.test.ts +94 -0
  455. package/src/__tests__/ssr-recovery-errors.unit.test.ts +58 -0
  456. package/src/__tests__/standard-cluster-capability.integration.test.ts +63 -0
  457. package/src/__tests__/standard-cluster-transport.unit.test.ts +121 -0
  458. package/src/__tests__/standard-cluster-variant-resolution.unit.test.ts +299 -0
  459. package/src/__tests__/standard-clustered-pipeline.unit.test.ts +15 -5
  460. package/src/__tests__/standard-lighting-inspection.integration.test.ts +138 -0
  461. package/src/__tests__/standard-lighting-ssot.unit.test.ts +18 -0
  462. package/src/__tests__/standard-lighting-write.unit.test.ts +441 -0
  463. package/src/__tests__/standard-lighting.integration.test.ts +67 -0
  464. package/src/__tests__/standard-pipeline.dawn.test.ts +206 -5
  465. package/src/__tests__/standard-pipeline.integration.test.ts +181 -150
  466. package/src/__tests__/standard-probe-binding.unit.test.ts +25 -0
  467. package/src/__tests__/standard-profile-oracle.unit.test.ts +23 -38
  468. package/src/__tests__/temporal-fallback-generation.integration.test.ts +16 -0
  469. package/src/__tests__/temporal-view.unit.test.ts +3 -3
  470. package/src/__tests__/transmission-prewarm.unit.test.ts +69 -0
  471. package/src/__tests__/typed-pipeline-topology.unit.test.ts +395 -14
  472. package/src/__tests__/urp-pipeline-targets.unit.test.ts +2 -2
  473. package/src/__tests__/visibility-budget.integration.test.ts +140 -0
  474. package/src/__tests__/visibility-budget.unit.test.ts +70 -0
  475. package/src/__tests__/visibility-extract.integration.test.ts +11 -6
  476. package/src/__tests__/visibility-resolver.unit.test.ts +15 -0
  477. package/src/__tests__/volumetric-fog-point-spot-accumulation.integration.test.ts +6 -3
  478. package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +31 -28
  479. package/src/assembly/backend-contract.ts +13 -0
  480. package/src/assembly/device-feature-admission.ts +80 -0
  481. package/src/assembly/directional-shadow-inspection.ts +122 -0
  482. package/src/assembly/factory.ts +1411 -366
  483. package/src/assembly/host-contract.ts +35 -0
  484. package/src/assembly/render-target-host.ts +847 -0
  485. package/src/assets/asset-decoders.ts +1 -1
  486. package/src/assets/render-asset-port.ts +7 -1
  487. package/src/capture/cube-views.ts +69 -0
  488. package/src/capture/scheduler.ts +265 -0
  489. package/src/cluster-binner.ts +31 -0
  490. package/src/components/__tests__/lighting-authoring.unit.test.ts +39 -0
  491. package/src/components/__tests__/rect-area-light.unit.test.ts +33 -0
  492. package/src/components/__tests__/schema-contract.unit.test.ts +12 -0
  493. package/src/components/__tests__/schema-parity.unit.test.ts +9 -0
  494. package/src/components/camera.ts +4 -0
  495. package/src/components/cube-camera.ts +52 -0
  496. package/src/components/directional-light.ts +22 -2
  497. package/src/components/directional-shadow-filter.ts +57 -0
  498. package/src/components/index.ts +5 -0
  499. package/src/components/light-helpers.ts +133 -8
  500. package/src/components/light-probe.ts +13 -0
  501. package/src/components/rect-area-light.ts +15 -0
  502. package/src/components/reflection-probe.ts +49 -0
  503. package/src/components/scene-instance.ts +6 -0
  504. package/src/components/spot-light.ts +3 -0
  505. package/src/device/__tests__/extended-lighting-recovery.unit.test.ts +24 -0
  506. package/src/device/gpu-residency.ts +140 -9
  507. package/src/device/lifecycle-transaction.ts +12 -0
  508. package/src/environment/frame.ts +6 -24
  509. package/src/environment/lifecycle.ts +20 -1
  510. package/src/errors/gpu-driven.ts +92 -0
  511. package/src/errors/index.ts +1 -0
  512. package/src/errors/recover.ts +32 -0
  513. package/src/errors/render.ts +341 -143
  514. package/src/extract/camera.ts +3 -3
  515. package/src/extract/directional-shadow-projection.ts +61 -0
  516. package/src/extract/environment.ts +57 -0
  517. package/src/extract/gpu-driven.ts +108 -0
  518. package/src/extract/visibility.ts +2 -1
  519. package/src/features/fullscreen.ts +3 -0
  520. package/src/features/targets.ts +4 -1
  521. package/src/features/types.ts +10 -0
  522. package/src/fullscreen-post-process-pass.ts +43 -2
  523. package/src/gpu-driven/batch-topology.ts +207 -28
  524. package/src/gpu-driven/prepared-draw.ts +208 -0
  525. package/src/gpu-driven/production-raster.ts +953 -43
  526. package/src/gpu-driven/view-gpu.ts +411 -29
  527. package/src/gpu-scene-schema.ts +13 -0
  528. package/src/gpu-scene.ts +140 -64
  529. package/src/gpu-usage.ts +0 -1
  530. package/src/hdrp-buffers.ts +169 -63
  531. package/src/ibl/IblPipelineCache.ts +11 -0
  532. package/src/ibl/kernel-cache.ts +88 -0
  533. package/src/index.ts +222 -0
  534. package/src/inspection-types.ts +276 -1
  535. package/src/instances-derived-bounds.ts +171 -0
  536. package/src/internal.ts +38 -0
  537. package/src/light-buffer-layout.ts +155 -310
  538. package/src/materials.ts +16 -2
  539. package/src/mesh-material-bindings.ts +132 -0
  540. package/src/pbr-pipeline.ts +255 -60
  541. package/src/pipeline/standard-forward-lane.ts +93 -16
  542. package/src/pipeline/standard-lighting/errors.ts +6 -0
  543. package/src/pipeline/standard-lighting/graph.ts +158 -0
  544. package/src/pipeline/standard-lighting/inspection.ts +88 -0
  545. package/src/pipeline/standard-lighting/layout.ts +31 -0
  546. package/src/pipeline/standard-lighting/light-frame.ts +35 -0
  547. package/src/pipeline/standard-lighting/membership.ts +43 -0
  548. package/src/pipeline/standard-lighting/prepare.ts +37 -0
  549. package/src/pipeline/standard-lighting/topology.ts +120 -0
  550. package/src/pipeline/standard-lighting/transport.ts +78 -0
  551. package/src/pipeline/standard-pipeline.ts +124 -193
  552. package/src/pipeline/standard-post.ts +26 -7
  553. package/src/pipeline/standard-profile.ts +17 -47
  554. package/src/pipeline-builder.ts +5 -2
  555. package/src/pipeline-spec.ts +95 -21
  556. package/src/plugin.ts +4 -0
  557. package/src/point-shadow-inspection.ts +55 -0
  558. package/src/prepare/__tests__/extended-lighting-capability.unit.test.ts +56 -0
  559. package/src/prepare/extended-lighting/ltc-resources.ts +136 -0
  560. package/src/prepare/extended-lighting/resources.ts +389 -0
  561. package/src/prepare/extended-lighting/spot-modifiers.ts +194 -0
  562. package/src/prepare/extended-lighting/state.ts +92 -0
  563. package/src/record/__tests__/gpu-timing.unit.test.ts +177 -0
  564. package/src/record/__tests__/temporal-payload.unit.test.ts +64 -1
  565. package/src/record/__tests__/transparent-group2-selection.unit.test.ts +73 -0
  566. package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +20 -1
  567. package/src/record/__tests__/view-ubo-layout.unit.test.ts +40 -0
  568. package/src/record/frame-lighting.ts +591 -452
  569. package/src/record/frame-snapshot.ts +92 -39
  570. package/src/record/frame-targets.ts +17 -0
  571. package/src/record/frame.ts +662 -158
  572. package/src/record/gpu-pass-timing/contract.ts +180 -0
  573. package/src/record/gpu-pass-timing/errors.ts +34 -0
  574. package/src/record/gpu-pass-timing/index.ts +37 -0
  575. package/src/record/gpu-pass-timing/parser.ts +97 -0
  576. package/src/record/gpu-pass-timing/session.ts +938 -0
  577. package/src/record/gpu-timing.ts +112 -39
  578. package/src/record/helpers.ts +0 -58
  579. package/src/record/main-pass-geometry.ts +324 -119
  580. package/src/record/main-pass-material.ts +103 -10
  581. package/src/record/main-pass-sprite-draws.ts +99 -103
  582. package/src/record/main-pass.ts +71 -15
  583. package/src/record/mesh-ssbo.ts +47 -36
  584. package/src/record/render-context.ts +136 -3
  585. package/src/record/shadow-pass.ts +83 -68
  586. package/src/record/skybox-post-pass.ts +20 -4
  587. package/src/record/typed-frame-graph.ts +1034 -43
  588. package/src/record/view-ubo.ts +72 -47
  589. package/src/reflection/filter.ts +81 -0
  590. package/src/reflection/gpu-table.ts +44 -0
  591. package/src/reflection/inspection.ts +67 -0
  592. package/src/reflection/projection.ts +476 -0
  593. package/src/reflection/record-owner.ts +1283 -0
  594. package/src/render-contract.ts +93 -10
  595. package/src/render-graph-primitives.ts +9 -4
  596. package/src/render-pipeline.ts +122 -2
  597. package/src/render-system-extract.ts +1041 -225
  598. package/src/render-system.ts +1310 -85
  599. package/src/renderer.ts +222 -0
  600. package/src/scene/__tests__/changed-block-summary.candidate.test.ts +36 -0
  601. package/src/scene/probe-blend-record.ts +54 -0
  602. package/src/scene/probe-blend.ts +813 -0
  603. package/src/scene/render-scene-types.ts +0 -7
  604. package/src/scene/render-scene.ts +942 -171
  605. package/src/scene/visibility/bounds.ts +57 -0
  606. package/src/scene/visibility/budget.ts +40 -0
  607. package/src/scene/visibility/facet.ts +400 -0
  608. package/src/scene/visibility/gpu-frame-timing.ts +101 -0
  609. package/src/scene/visibility/gpu-lod.ts +119 -0
  610. package/src/scene/visibility/inspection.ts +313 -0
  611. package/src/scene/visibility/lod-selector.ts +84 -0
  612. package/src/scene/visibility/occlusion-confidence.ts +478 -0
  613. package/src/scene/visibility/occlusion-pass.ts +165 -0
  614. package/src/scene/visibility/occlusion-query-pool.ts +178 -0
  615. package/src/scene/visibility/occlusion-runtime.ts +672 -0
  616. package/src/scene/visibility/types.ts +50 -0
  617. package/src/shadow-atlas.ts +5 -5
  618. package/src/ssao-buffers.ts +9 -2
  619. package/src/ssr/admission.ts +451 -0
  620. package/src/ssr/composition.ts +73 -0
  621. package/src/ssr/errors.ts +76 -0
  622. package/src/ssr/identity.ts +12 -0
  623. package/src/systems/skin-palette-allocator.ts +1 -1
  624. package/src/targets/contracts.ts +182 -0
  625. package/src/targets/graph-projection.ts +169 -0
  626. package/src/targets/material-source.ts +143 -0
  627. package/src/targets/owner.ts +214 -0
  628. package/src/targets/physical.ts +18 -0
  629. package/src/targets/readback.ts +153 -0
  630. package/src/temporal/frame-coordinator.ts +26 -0
  631. package/src/temporal/frame.ts +14 -1
  632. package/src/temporal/view.ts +11 -0
  633. package/src/tilemap-chunk-extract-system.ts +4 -4
  634. package/src/transmission/__tests__/standard-transmission.dawn.test.ts +59 -20
  635. package/src/typed-render-graph-primitives.ts +53 -3
  636. package/src/typed-shadow-passes.ts +46 -40
  637. package/src/volume/passes.ts +61 -58
  638. package/dist/.tsbuildinfo +0 -1
  639. package/dist/chunk-4XINDLAY.mjs.map +0 -1
  640. package/dist/chunk-CDTWTHZR.mjs.map +0 -1
  641. package/dist/chunk-M2MP4ZOU.mjs +0 -73
  642. package/dist/chunk-M2MP4ZOU.mjs.map +0 -1
  643. package/dist/chunk-PCHBPYML.mjs.map +0 -1
  644. package/dist/chunk-TBQJOK2L.mjs.map +0 -1
  645. package/dist/chunk-VFPLTKCU.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/temporal/coverage.ts","../src/temporal/temporal-view.ts","../src/temporal/taa-history-store.ts","../src/temporal/frame-coordinator.ts"],"names":[],"mappings":";;;;AAqBO,SAAS,sBAAA,CAAuB,OAAe,MAAA,E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AAA,GACA,MAAA,KAAW,mBAAA,IAAuB,MAAA,KAAW,aAAA,GAC3C,mBAAA,GACA;AAAA,KACV;AACA,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA;AACf,IAAA,IAAA,CAAK,cAAA,GAAiB,MAAA;AACtB,IAAA,IAAA,CAAK,WAAA,GAAc,MAAA;AACnB,IAAA,IAAA,CAAK,QAAA,GAAW;AAAA,MACd,qBAAqB,EAAC;AAAA,MACtB,wBAAwB,EAAC;AAAA,MACzB,uBAAuB,EAAC;AAAA,MACxB,8BAAA,EAAgC;AAAA,KAClC;AAAA,EACF;AAAA,EAEQ,eAAe,KAAA,EAAoC;AACzD,IAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,IAAA,IAAQ,WAAW,KAAA,EAAO;AACnE,MAAA,MAAM,QAAS,KAAA,CAA8B,KAAA;AAC7C,MAAA,IAAI,UAAU,OAAA,IAAW,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,YAAY,KAAA,KAAU,QAAA;AAC7E,QAAA,OAAO,KAAA;AAAA,IACX;AACA,IAAA,OAAO,QAAA;AAAA,EACT;AACF","file":"chunk-PCHBPYML.mjs","sourcesContent":["import type { SceneDataLane, SceneDataSchemaId } from './scene-data';\n\nexport interface SceneDataCoverage {\n readonly schema: SceneDataSchemaId;\n readonly lane: SceneDataLane;\n readonly producerId: string;\n readonly complete: boolean;\n readonly contributorIds: readonly string[];\n readonly exactContributorIds: readonly string[];\n readonly reactiveContributorIds: readonly string[];\n readonly missingContributorIds: readonly string[];\n readonly omittedMissingContributorCount: number;\n}\n\nexport interface TemporalCoverage {\n readonly width: number;\n readonly height: number;\n readonly bytes: number;\n readonly fullScreen: true;\n}\n\nexport function createTemporalCoverage(width: number, height: number): TemporalCoverage {\n if (!Number.isSafeInteger(width) || width <= 0) throw new RangeError('width must be positive.');\n if (!Number.isSafeInteger(height) || height <= 0)\n throw new RangeError('height must be positive.');\n return Object.freeze({ width, height, bytes: 32 * width * height, fullScreen: true as const });\n}\n\nexport type SceneDataContributorKind = 'exact' | 'reactive';\nexport interface SceneDataContributor {\n readonly id: string;\n readonly kind: SceneDataContributorKind;\n}\nexport function classifySceneDataCoverage(input: {\n readonly contributors: readonly SceneDataContributor[];\n readonly requiredContributorIds: readonly string[];\n}): {\n readonly exactContributorIds: readonly string[];\n readonly reactiveContributorIds: readonly string[];\n readonly missingContributorIds: readonly string[];\n readonly omittedMissingContributorCount: number;\n readonly complete: boolean;\n} {\n const exactContributorIds = input.contributors.filter((c) => c.kind === 'exact').map((c) => c.id);\n const reactiveContributorIds = input.contributors\n .filter((c) => c.kind === 'reactive')\n .map((c) => c.id);\n const available = new Set(input.contributors.map((c) => c.id));\n const missing = input.requiredContributorIds.filter((id) => !available.has(id));\n return {\n exactContributorIds: Object.freeze(exactContributorIds),\n reactiveContributorIds: Object.freeze(reactiveContributorIds),\n missingContributorIds: Object.freeze(missing.slice(0, 32)),\n omittedMissingContributorCount: Math.max(0, missing.length - 32),\n complete: missing.length === 0,\n };\n}\nexport function scanSceneDataCoverage(input: {\n readonly schema: SceneDataSchemaId;\n readonly lane: SceneDataLane;\n readonly producerId: string;\n readonly contributorIds: readonly string[];\n readonly requiredContributorIds: readonly string[];\n}): SceneDataCoverage {\n const classification = classifySceneDataCoverage({\n contributors: input.contributorIds.map((id) => ({ id, kind: 'exact' as const })),\n requiredContributorIds: input.requiredContributorIds,\n });\n return Object.freeze({\n schema: input.schema,\n lane: input.lane,\n producerId: input.producerId,\n ...classification,\n contributorIds: Object.freeze([...input.contributorIds]),\n });\n}\n","import { mat4 } from '@forgeax/engine-math';\nimport type { CameraProjection } from '../components/camera';\nimport type { CameraSnapshot } from '../render-contract';\n\nexport const TEMPORAL_JITTER_SAMPLE_COUNT = 8;\n\nexport type TemporalViewResetReason =\n | 'first-frame'\n | 'camera-switch'\n | 'history-version-changed'\n | 'projection-kind-changed'\n | 'projection-range-changed';\n\nexport interface SubmittedTemporalView {\n readonly viewId: string;\n readonly historyVersion: number;\n readonly projection: CameraProjection;\n readonly near: number;\n readonly far: number;\n readonly jitterUv: readonly [number, number];\n readonly unjitteredViewProjection: Float32Array;\n}\n\nexport interface TemporalView {\n readonly viewId: string;\n readonly historyVersion: number;\n readonly temporalFrameIndex: number;\n readonly historyValid: boolean;\n readonly resetReason: TemporalViewResetReason | undefined;\n readonly currentJitterUv: readonly [number, number];\n readonly previousJitterUv: readonly [number, number];\n readonly currentJitteredViewProjection: Float32Array;\n readonly currentUnjitteredViewProjection: Float32Array;\n readonly previousUnjitteredViewProjection: Float32Array;\n readonly projection: CameraProjection;\n readonly near: number;\n readonly far: number;\n}\n\nexport interface TemporalViewInput {\n readonly camera: CameraSnapshot;\n readonly temporalFrameIndex: number;\n readonly surfaceWidth: number;\n readonly surfaceHeight: number;\n readonly lastSubmitted?: SubmittedTemporalView;\n}\n\nexport function temporalViewId(worldId: number, entityKey: number): string {\n const raw = entityKey >>> 0;\n const index = raw & 0x00ffffff;\n const generation = (raw >>> 24) & 0xff;\n return `${worldId}:${index}:${generation}`;\n}\n\nfunction halton(index: number, base: number): number {\n let result = 0;\n let fraction = 1 / base;\n let value = index;\n while (value > 0) {\n result += fraction * (value % base);\n value = Math.floor(value / base);\n fraction /= base;\n }\n return result;\n}\n\nexport function temporalJitterSample(temporalFrameIndex: number): readonly [number, number] {\n const sampleIndex =\n ((Math.trunc(temporalFrameIndex) % TEMPORAL_JITTER_SAMPLE_COUNT) +\n TEMPORAL_JITTER_SAMPLE_COUNT) %\n TEMPORAL_JITTER_SAMPLE_COUNT;\n const haltonIndex = sampleIndex + 1;\n return [halton(haltonIndex, 2) - 0.5, halton(haltonIndex, 3) - 0.5];\n}\n\nfunction temporalJitterUv(\n temporalFrameIndex: number,\n surfaceWidth: number,\n surfaceHeight: number,\n): readonly [number, number] {\n const sample = temporalJitterSample(temporalFrameIndex);\n return [sample[0] / Math.max(1, surfaceWidth), sample[1] / Math.max(1, surfaceHeight)];\n}\n\nfunction cameraProjection(camera: CameraSnapshot): Float32Array {\n const projection = mat4.create();\n if (camera.projection === 'orthographic') {\n mat4.orthographic(\n projection,\n camera.orthoLeft,\n camera.orthoRight,\n camera.orthoBottom,\n camera.orthoTop,\n camera.near,\n camera.far,\n );\n } else {\n mat4.perspective(projection, camera.fov, camera.aspect, camera.near, camera.far);\n }\n return projection;\n}\n\nfunction resetReason(\n current: CameraSnapshot,\n viewId: string,\n previous: SubmittedTemporalView | undefined,\n): TemporalViewResetReason | undefined {\n if (previous === undefined) return 'first-frame';\n if (previous.viewId !== viewId) return 'camera-switch';\n if (previous.historyVersion !== (current.historyVersion ?? 0)) {\n return 'history-version-changed';\n }\n if (previous.projection !== current.projection) return 'projection-kind-changed';\n if (!Object.is(previous.near, current.near) || !Object.is(previous.far, current.far)) {\n return 'projection-range-changed';\n }\n return undefined;\n}\n\nexport function projectTemporalView(input: TemporalViewInput): TemporalView {\n const { camera } = input;\n const viewId = temporalViewId(camera.worldId ?? 0, camera.entityKey ?? 0);\n const currentJitterUv = temporalJitterUv(\n input.temporalFrameIndex,\n input.surfaceWidth,\n input.surfaceHeight,\n );\n const view = mat4.invert(mat4.create(), camera.world);\n const projection = cameraProjection(camera);\n const currentUnjitteredViewProjection = mat4.multiply(mat4.create(), projection, view);\n const clipJitter = mat4.identity(mat4.create());\n clipJitter[12] = currentJitterUv[0] * 2;\n clipJitter[13] = currentJitterUv[1] * -2;\n const jitteredProjection = mat4.multiply(mat4.create(), clipJitter, projection);\n const currentJitteredViewProjection = mat4.multiply(mat4.create(), jitteredProjection, view);\n const reason = resetReason(camera, viewId, input.lastSubmitted);\n const historyValid = reason === undefined;\n return {\n viewId,\n historyVersion: camera.historyVersion ?? 0,\n temporalFrameIndex: input.temporalFrameIndex,\n historyValid,\n resetReason: reason,\n currentJitterUv,\n previousJitterUv: historyValid\n ? (input.lastSubmitted?.jitterUv ?? currentJitterUv)\n : currentJitterUv,\n currentJitteredViewProjection,\n currentUnjitteredViewProjection,\n previousUnjitteredViewProjection: historyValid\n ? (input.lastSubmitted?.unjitteredViewProjection ?? currentUnjitteredViewProjection)\n : currentUnjitteredViewProjection,\n projection: camera.projection,\n near: camera.near,\n far: camera.far,\n };\n}\n\nexport function snapshotSubmittedTemporalView(view: TemporalView): SubmittedTemporalView {\n return {\n viewId: view.viewId,\n historyVersion: view.historyVersion,\n projection: view.projection,\n near: view.near,\n far: view.far,\n jitterUv: [view.currentJitterUv[0], view.currentJitterUv[1]],\n unjitteredViewProjection: new Float32Array(view.currentUnjitteredViewProjection),\n };\n}\n","export type TaaHistoryResetReason =\n | 'first-frame'\n | 'camera-cut'\n | 'resize'\n | 'recover'\n | 'device-generation';\n\nexport interface TaaHistoryInspection {\n readonly generation: number;\n readonly seed: number;\n readonly attempt: 'none' | 'active' | 'committed' | 'aborted';\n readonly valid: boolean;\n readonly resetReason: TaaHistoryResetReason | undefined;\n}\n\nexport interface TaaHistoryAttempt {\n readonly generation: number;\n readonly seed: number;\n commit(): void;\n abort(): void;\n}\n\n/** TAA-only history owner. No global registry or backend handle crosses this boundary. */\nexport class TaaHistoryStore {\n private generation = 0;\n private seed = 0;\n private valid = false;\n private attempt: TaaHistoryInspection['attempt'] = 'none';\n private resetReason: TaaHistoryResetReason | undefined;\n\n begin(reason: TaaHistoryResetReason | undefined = undefined): TaaHistoryAttempt {\n const generation = this.generation;\n const seed = this.seed;\n this.attempt = 'active';\n let state: 'active' | 'committed' | 'aborted' = 'active';\n return {\n generation,\n seed,\n commit: () => {\n if (state !== 'active') return;\n state = 'committed';\n this.attempt = 'committed';\n this.valid = true;\n this.generation += 1;\n this.seed += 1;\n this.resetReason = reason;\n },\n abort: () => {\n if (state !== 'active') return;\n state = 'aborted';\n this.attempt = 'aborted';\n },\n };\n }\n\n seedHistory(reason: TaaHistoryResetReason = 'first-frame'): void {\n this.valid = false;\n this.resetReason = reason;\n this.attempt = 'none';\n }\n\n reset(reason: TaaHistoryResetReason): void {\n this.generation = 0;\n this.seed = 0;\n this.valid = false;\n this.attempt = 'none';\n this.resetReason = reason;\n }\n\n inspect(): TaaHistoryInspection {\n return {\n generation: this.generation,\n seed: this.seed,\n attempt: this.attempt,\n valid: this.valid,\n resetReason: this.resetReason,\n };\n }\n}\n","import { err, ok, type Result } from '@forgeax/engine-types';\nimport type { CameraSnapshot } from '../render-contract';\nimport { classifySceneDataCoverage, type SceneDataContributor } from './coverage';\nimport { type TaaHistoryAttempt, TaaHistoryStore } from './taa-history-store';\nimport {\n projectTemporalView,\n type SubmittedTemporalView,\n snapshotSubmittedTemporalView,\n type TemporalView,\n} from './temporal-view';\n\n/** The only stages that may publish a temporal frame. */\nexport type TemporalFrameStage = 'build' | 'encode' | 'finish' | 'submit';\n\nexport type TemporalFrameErrorCode = 'taa-unavailable' | 'temporal-active' | 'temporal-not-active';\n\nexport interface TemporalFrameError {\n readonly code: TemporalFrameErrorCode;\n readonly expected: string;\n readonly hint: string;\n readonly detail?: Readonly<Record<string, unknown>>;\n}\n\nexport interface TemporalFrameSnapshot<T = unknown> {\n readonly epoch: number;\n readonly previous: T | undefined;\n readonly historyAttempt: 'none' | 'active' | 'committed' | 'aborted';\n readonly attempt: 'none' | 'active' | 'committed' | 'aborted';\n readonly lastFailure: TemporalFrameStage | undefined;\n readonly coverage: {\n readonly exactContributorIds: readonly string[];\n readonly reactiveContributorIds: readonly string[];\n readonly missingContributorIds: readonly string[];\n readonly omittedMissingContributorCount: number;\n };\n}\n\nexport interface TemporalFrameBeginInput<T = unknown> {\n readonly current: T;\n readonly antialias: 'none' | 'fxaa' | 'msaa' | 'taa';\n /** Enables the shared transaction for a temporal feature without TAA. */\n readonly temporalDemand?: boolean;\n readonly available?: boolean;\n readonly contributors?: readonly SceneDataContributor[];\n readonly requiredContributorIds?: readonly string[];\n /** Projection produced before record uploads; it commits with the frame. */\n readonly temporalView?: TemporalView;\n}\n\nexport interface TemporalFrameCandidate<T = unknown> {\n readonly epoch: number;\n readonly current: T;\n readonly previous: T | undefined;\n readonly history: { readonly direction: 'a-to-b' | 'b-to-a'; readonly valid: boolean };\n readonly contributors: readonly SceneDataContributor[];\n readonly requiredContributorIds: readonly string[];\n readonly temporalView?: TemporalView;\n}\n\nexport interface TemporalFramePhases<T = unknown> {\n readonly build: () => T;\n readonly encode: (built: T) => void;\n readonly finish: () => void;\n readonly submit: () => void;\n}\n\nexport interface TemporalFrameReceipt<T = unknown> {\n readonly epoch: number;\n readonly previous: T;\n readonly historyDirection: 'a-to-b' | 'b-to-a';\n}\n\nfunction failure(code: TemporalFrameErrorCode, hint: string): TemporalFrameError {\n return {\n code,\n expected:\n code === 'taa-unavailable'\n ? 'TAA resources and capability are available'\n : 'one temporal frame is active',\n hint,\n };\n}\n\n/**\n * Renderer-owned temporal transaction. It has no graph or backend dependency:\n * graph assembly supplies the four phase callbacks and only submit publishes\n * the candidate snapshot.\n */\nexport class TemporalFrameCoordinator<T = unknown> {\n readonly historyStore: TaaHistoryStore;\n private epoch: number;\n private previous: T | undefined;\n private active: TemporalFrameCandidate<T> | undefined;\n private attempt: TemporalFrameSnapshot<T>['attempt'] = 'none';\n private historyAttempt: TemporalFrameSnapshot<T>['historyAttempt'] = 'none';\n private lastFailure: TemporalFrameStage | undefined;\n private historyDirection: 'a-to-b' | 'b-to-a' = 'a-to-b';\n private temporalFrameIndex = 0;\n private lastSubmittedView: SubmittedTemporalView | undefined;\n private coverage: TemporalFrameSnapshot<T>['coverage'] = {\n exactContributorIds: [],\n reactiveContributorIds: [],\n missingContributorIds: [],\n omittedMissingContributorCount: 0,\n };\n private readonly historyAttempts = new WeakMap<object, TaaHistoryAttempt>();\n\n constructor(\n initial: {\n readonly epoch?: number;\n readonly previous?: T;\n readonly historyStore?: TaaHistoryStore;\n } = {},\n ) {\n this.historyStore = initial.historyStore ?? new TaaHistoryStore();\n this.epoch = initial.epoch ?? 0;\n this.previous = initial.previous;\n }\n\n begin(input: TemporalFrameBeginInput<T>): Result<TemporalFrameCandidate<T>, TemporalFrameError> {\n const demanded = input.antialias === 'taa' || input.temporalDemand === true;\n if (!demanded) {\n return ok({\n epoch: this.epoch,\n current: input.current,\n previous: this.previous,\n history: { direction: this.historyDirection, valid: false },\n contributors: Object.freeze([...(input.contributors ?? [])]),\n requiredContributorIds: Object.freeze([...(input.requiredContributorIds ?? [])]),\n ...(input.temporalView === undefined ? {} : { temporalView: input.temporalView }),\n });\n }\n if (input.available === false) {\n return err(\n failure('taa-unavailable', 'enable rgba16float temporal targets and retry the frame'),\n );\n }\n if (this.active !== undefined) {\n return err(\n failure(\n 'temporal-active',\n 'commit or abort the active temporal frame before beginning another',\n ),\n );\n }\n const candidate: TemporalFrameCandidate<T> = {\n epoch: this.epoch + 1,\n current: input.current,\n previous: this.previous,\n history: { direction: this.historyDirection, valid: this.previous !== undefined },\n contributors: Object.freeze([...(input.contributors ?? [])]),\n requiredContributorIds: Object.freeze([...(input.requiredContributorIds ?? [])]),\n ...(input.temporalView === undefined ? {} : { temporalView: input.temporalView }),\n };\n if (input.antialias === 'taa') {\n this.historyAttempts.set(candidate, this.historyStore.begin());\n }\n this.active = candidate;\n this.attempt = 'active';\n this.historyAttempt = input.antialias === 'taa' ? 'active' : 'none';\n this.lastFailure = undefined;\n return ok(candidate);\n }\n\n commit(\n candidate: TemporalFrameCandidate<T>,\n ): Result<TemporalFrameReceipt<T>, TemporalFrameError> {\n if (this.active !== candidate) {\n return err(failure('temporal-not-active', 'commit the candidate returned by begin'));\n }\n this.epoch = candidate.epoch;\n this.previous = candidate.current;\n if (candidate.temporalView !== undefined) {\n this.lastSubmittedView = snapshotSubmittedTemporalView(candidate.temporalView);\n this.temporalFrameIndex += 1;\n }\n this.historyDirection = candidate.history.direction === 'a-to-b' ? 'b-to-a' : 'a-to-b';\n const historyAttempt = this.historyAttempts.get(candidate);\n historyAttempt?.commit();\n this.coverage = classifySceneDataCoverage({\n contributors: candidate.contributors,\n requiredContributorIds: candidate.requiredContributorIds,\n });\n this.active = undefined;\n historyAttempt?.abort();\n this.historyAttempts.delete(candidate);\n this.attempt = 'committed';\n this.historyAttempt = historyAttempt === undefined ? 'none' : 'committed';\n return ok({\n epoch: this.epoch,\n previous: candidate.current,\n historyDirection: candidate.history.direction,\n });\n }\n\n abort(candidate: TemporalFrameCandidate<T>, stage: TemporalFrameStage = 'submit'): void {\n if (this.active !== candidate) return;\n this.historyAttempts.get(candidate)?.abort();\n this.historyAttempts.delete(candidate);\n this.active = undefined;\n this.attempt = 'aborted';\n this.historyAttempt = 'aborted';\n this.lastFailure = stage;\n }\n\n run(\n input: TemporalFrameBeginInput<T>,\n phases: TemporalFramePhases<T>,\n ): Result<TemporalFrameReceipt<T> | undefined, TemporalFrameError> {\n const started = this.begin(input);\n if (!started.ok) return started;\n const candidate = started.value;\n if (input.antialias !== 'taa' && input.temporalDemand !== true) return ok(undefined);\n try {\n const built = phases.build();\n phases.encode(built);\n phases.finish();\n phases.submit();\n } catch (cause) {\n const stage = this.stageFromError(cause);\n this.abort(candidate, stage);\n return err({\n code: 'temporal-not-active',\n expected: `temporal ${stage} succeeds before commit`,\n hint: 'inspect the underlying stage failure and retry the frame',\n detail: { stage, cause },\n });\n }\n return this.commit(candidate);\n }\n\n inspect(): TemporalFrameSnapshot<T> {\n return {\n epoch: this.epoch,\n previous: this.previous,\n historyAttempt: this.historyAttempt,\n attempt: this.attempt,\n lastFailure: this.lastFailure,\n coverage: this.coverage,\n };\n }\n\n /**\n * Derive the current/previous camera matrices without mutating history.\n * `commit()` is the only operation that publishes the returned view, so a\n * graph/finish/submit failure leaves the last successful view intact.\n */\n prepareTemporalView(\n camera: CameraSnapshot,\n surfaceWidth: number,\n surfaceHeight: number,\n ): TemporalView | undefined {\n const demanded =\n camera.antialias === 'taa' ||\n (camera.motionBlur?.shutterAngle !== undefined && camera.motionBlur.shutterAngle > 0);\n if (!demanded) return undefined;\n return projectTemporalView({\n camera,\n temporalFrameIndex: this.temporalFrameIndex,\n surfaceWidth,\n surfaceHeight,\n ...(this.lastSubmittedView === undefined ? {} : { lastSubmitted: this.lastSubmittedView }),\n });\n }\n\n reset(\n reason:\n | 'cut'\n | 'resize'\n | 'camera-switch'\n | 'detach'\n | 'recover'\n | 'device-loss'\n | 'device-generation' = 'recover',\n ): void {\n void reason;\n this.active = undefined;\n this.epoch = 0;\n this.previous = undefined;\n this.temporalFrameIndex = 0;\n this.lastSubmittedView = undefined;\n this.historyDirection = 'a-to-b';\n this.historyStore.reset(\n reason === 'cut' || reason === 'camera-switch'\n ? 'camera-cut'\n : reason === 'resize'\n ? 'resize'\n : reason === 'device-generation' || reason === 'device-loss'\n ? 'device-generation'\n : 'recover',\n );\n this.attempt = 'none';\n this.historyAttempt = 'none';\n this.lastFailure = undefined;\n this.coverage = {\n exactContributorIds: [],\n reactiveContributorIds: [],\n missingContributorIds: [],\n omittedMissingContributorCount: 0,\n };\n }\n\n private stageFromError(cause: unknown): TemporalFrameStage {\n if (typeof cause === 'object' && cause !== null && 'stage' in cause) {\n const stage = (cause as { stage?: unknown }).stage;\n if (stage === 'build' || stage === 'encode' || stage === 'finish' || stage === 'submit')\n return stage;\n }\n return 'submit';\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/errors/render.ts","../src/temporal/scene-data.ts","../src/temporal/scene-data-catalog.ts","../src/pipeline/standard-profile.ts","../src/render-contract.ts"],"names":[],"mappings":";;;AA2CO,IAAM,0BAAA,GAAN,cAAyC,KAAA,CAAM;AAAA,EAC3C,IAAA,GAAO,+BAAA;AAAA,EACP,QAAA,GAAW,4DAAA;AAAA,EACX,IAAA,GAAO,6EAAA;AAAA,EACP,MAAA;AAAA,EAET,YAAY,MAAA,EAA4C;AACtD,IAAA,KAAA,CAAM,CAAA,+BAAA,EAAkC,MAAA,CAAO,YAAY,CAAA,6BAAA,CAA+B,CAAA;AAC1F,IAAA,IAAA,CAAK,IAAA,GAAO,4BAAA;AACZ,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAAA,EAChB;AACF;AAoEO,IAAM,wBAAA,GAAN,cAAuC,KAAA,CAAM;AAAA,EACz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AG;AACL","file":"chunk-TBQJOK2L.mjs","sourcesContent":["// @forgeax/engine-render -- render cluster error classes.\n//\n// feat-20260704-runtime-tier1-decomposition M2 / w8 (D-3): the monolithic\n// errors.ts RuntimeErrorCode / RuntimeError top-level aggregate unions are\n// decomposed into five per-cluster files (render / asset / skin / recover /\n// environment). Each cluster owns a closed *ErrorCode code union + a closed\n// *Error class union; error class names, .code literals, and .detail shapes\n// are preserved byte-for-byte (OOS-4: zero semantic change).\n//\n// The render cluster holds the shadow / HDRP cluster-forward + deferred /\n// g-buffer / point-shadow-atlas / video-upload / vertex-storage-buffer render\n// path errors. ShadowInvalidConfigError is consumed by the DirectionalLight /\n// SpotLight / PointLightShadow component validators (forward cross-directory\n// import, no cycle -- research Finding C2).\n\nimport type {\n RenderSurfaceFailureDetail,\n SurfaceFailureCode,\n SurfaceFailureKind,\n} from '@forgeax/engine-render-graph';\nimport type { DeviceResourceKind, DeviceScopeReceipt } from '../device/resource-types';\nimport type {\n PreparedKind,\n RenderFeatureCapabilityKey,\n RenderFeatureRecovery,\n RenderFeatureStage,\n} from '../features/vocabulary';\nimport type { SceneDataLane, SceneDataSchemaId } from '../temporal/scene-data';\nimport type { TransmissionCapabilityFact } from '../transmission/backdrop';\n\nexport interface LifecycleConstructionFailureDetail {\n readonly owner: string;\n readonly generation: number;\n readonly operation: 'create' | 'dispose';\n readonly resourceKind: DeviceResourceKind;\n readonly cause: unknown;\n readonly cleanupFailures: readonly {\n readonly resourceKind: DeviceResourceKind;\n readonly cause: unknown;\n }[];\n readonly receipt: DeviceScopeReceipt;\n}\n\nexport class LifecycleConstructionError extends Error {\n readonly code = 'lifecycle-construction-failed' as const;\n readonly expected = 'all DeviceScope resources establish and terminate in order';\n readonly hint = 'inspect detail and cleanupFailures, then recover or rebuild the DeviceScope';\n readonly detail: LifecycleConstructionFailureDetail;\n\n constructor(detail: LifecycleConstructionFailureDetail) {\n super(`lifecycle-construction-failed: ${detail.resourceKind} lifecycle transaction failed`);\n this.name = 'LifecycleConstructionError';\n this.detail = detail;\n }\n}\n\nconst SURFACE_FAILURE_POLICY: Readonly<\n Record<SurfaceFailureCode, { readonly expected: string; readonly hint: string }>\n> = {\n 'surface-allocation-failed': {\n expected: 'the required surface resource can be allocated with its declared format and usage',\n hint: 'inspect the capability detail, release transient resources, and retry the candidate graph',\n },\n 'surface-attachment-failed': {\n expected: 'the float target is renderable as the declared attachment',\n hint: 'verify float color attachment support and retry without hiding the failure',\n },\n 'surface-sampled-read-failed': {\n expected: 'the float target can be sampled by the next post-processing stage',\n hint: 'verify sampled-read support for the declared format before rebuilding the graph',\n },\n 'surface-view-domain-failed': {\n expected: 'surface storage and display views preserve their declared color domains',\n hint: 'repair the explicit format/domain pair and retry the candidate graph',\n },\n 'surface-raw-endpoint-failed': {\n expected: 'the surface presentation endpoint has descriptor, acquisition, and validation proof',\n hint: 'run the concrete presentation probe; keep the last-known-good surface when proof is absent',\n },\n};\n\n/** Render-surface failure with an exhaustive code and actionable detail. */\nexport class RenderSurfaceError<\n Code extends SurfaceFailureCode = SurfaceFailureCode,\n> extends Error {\n readonly code: Code;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderSurfaceFailureDetail;\n\n constructor(code: Code, detail: RenderSurfaceFailureDetail) {\n const policy = SURFACE_FAILURE_POLICY[code];\n if (policy === undefined) {\n throw new Error(`unknown render surface failure code: ${code}`);\n }\n super(`[RenderSurfaceError ${code}] expected: ${policy.expected}; hint: ${policy.hint}`);\n this.name = 'RenderSurfaceError';\n this.code = code;\n this.expected = policy.expected;\n this.hint = policy.hint;\n this.detail = detail;\n }\n}\n\nexport type { RenderSurfaceFailureDetail, SurfaceFailureCode, SurfaceFailureKind };\n\nexport type RenderSurfaceExpectedError = {\n readonly [Code in SurfaceFailureCode]: RenderSurfaceError<Code>;\n}[SurfaceFailureCode];\n\n/** Construct the closed surface error from its failure-stage discriminant. */\nexport function createRenderSurfaceError(\n kind: SurfaceFailureKind,\n detail: RenderSurfaceFailureDetail,\n): RenderSurfaceExpectedError {\n return new RenderSurfaceError(`surface-${kind}-failed` as SurfaceFailureCode, detail);\n}\n\nexport interface TemporalFrameSubmitDetail {\n readonly reason: 'queue-submit-failed';\n}\n\nexport class TemporalFrameSubmitError extends Error {\n readonly code = 'temporal-frame-submit-rejected' as const;\n readonly expected = 'the staged frame is accepted by queue.submit before temporal facts advance';\n readonly hint = 'inspect the queue submission and retry the frame after the device is available';\n readonly detail: TemporalFrameSubmitDetail;\n\n constructor(reason: 'queue-submit-failed') {\n super(`temporal-frame-submit-rejected: ${reason}`);\n this.name = 'TemporalFrameSubmitError';\n this.detail = { reason };\n }\n}\n\n// ── ShadowInvalidConfigError ──────────────────────────────────────────────\n\n/**\n * Detail for `RuntimeErrorCode 'shadow-invalid-config'`.\n *\n * Emitted by `DirectionalLight.validate` shadow-field path when a field value violates\n * runtime constraints (e.g. mapSize < 1, cascadeCount not in {1..4}).\n * AI users access `.detail.field` / `.detail.value` / `.detail.min` /\n * `.detail.max` via property access — no string parsing.\n *\n * `max` is `undefined` for lower-bound-only validations (e.g. mapSize < 1).\n * feat-20260613-csm: max added for upper-bound cascade validations\n * (cascadeCount max=4, splitLambda max=1, cascadeBlend max=0.5).\n */\nexport interface ShadowInvalidConfigDetail {\n readonly field: string;\n readonly value: number;\n readonly min: number;\n readonly max?: number;\n}\n\n/**\n * Structured error for shadow component config validation failures.\n *\n * Emitted by `DirectionalLight.validate()` shadow-field path (mapSize / cascadeCount /\n * splitLambda / cascadeBlend / shadowDistance) and `PointLightShadow.validate()`\n * (mapSize / farPlane > nearPlane / pcfKernelSize); both shadow component\n * types share this single error class so `switch (err.code)` on\n * `RuntimeErrorCode` only needs one branch (charter P4 — closed-union SSOT).\n * Four-field surface per AGENTS.md error model:\n * - `.code = 'shadow-invalid-config'` (closed RuntimeErrorCode)\n * - `.expected` — expected-state description (programmatic predicate form)\n * - `.hint` — actionable recovery guidance (imperative; AI users paste into\n * spawn calls). Integer-typed fields (e.g. `cascadeCount`, `pcfKernelSize`)\n * get an \"integer in [min, max]\" hint; otherwise \"[min, max]\" range or\n * \"<comparator> min\".\n * - `.detail = { field, value, min, max? }` — structured values (charter P4)\n *\n * 4th constructor parameter is a union over the two range shapes:\n * - `number` — `max` for a closed `[min, max]` range (CSM cascadeCount /\n * splitLambda / cascadeBlend). hint uses \"in [min, max]\"; integer-typed\n * fields get \"integer in [min, max]\".\n * - `'>' | '>='` — comparator for an open lower-bound predicate. `'>'` is\n * used when `min` carries dynamic context (e.g. `farPlane > nearPlane` —\n * the surfaced hint reads \"must be > nearPlane\" so AI users setting\n * farPlane=nearPlane don't re-fail the spawn loop with the wrong cue).\n * - `undefined` — defaults to `'>='`. Callsites for mapSize < 1 validation\n * stay backward-compatible (3-arg form).\n */\nexport class ShadowInvalidConfigError extends Error {\n readonly code = 'shadow-invalid-config' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: ShadowInvalidConfigDetail;\n\n constructor(field: string, value: number, min: number, maxOrComparator?: number | '>' | '>=') {\n const isComparator = maxOrComparator === '>' || maxOrComparator === '>=';\n const max = !isComparator && typeof maxOrComparator === 'number' ? maxOrComparator : undefined;\n const comparator: '>' | '>=' = isComparator ? (maxOrComparator as '>' | '>=') : '>=';\n // Integer-typed fields get an \"integer in [min, max]\" hint when a range\n // is supplied. Expand this set as new integer-typed shadow fields land.\n const isInteger = field === 'cascadeCount' || field === 'pcfKernelSize';\n // pcfKernelSize must be odd (kernel is symmetric around the center tap).\n // Naming \"odd\" in the hint stops an AI retry from looping min->min+1 (4->6).\n const isOdd = field === 'pcfKernelSize';\n const hint =\n max !== undefined\n ? isInteger\n ? `set ${field} to an integer in [${min}, ${max}]; got ${value}`\n : `set ${field} to a value in [${min}, ${max}]; got ${value}`\n : isOdd\n ? `set ${field} to an odd integer ${comparator} ${min}; got ${value}`\n : `set ${field} to a value ${comparator} ${min}; got ${value}`;\n const expected =\n max !== undefined ? `${field} in [${min}, ${max}]` : `${field} ${comparator} ${min}`;\n super(\n max !== undefined\n ? `shadow component .${field} must be in [${min}, ${max}], got ${value}`\n : `shadow component .${field} must be ${comparator} ${min}, got ${value}`,\n );\n this.name = 'ShadowInvalidConfigError';\n this.hint = hint;\n this.expected = expected;\n this.detail = { field, value, min, ...(max !== undefined ? { max } : {}) };\n }\n}\n\n// ── EquirectProjectionFailedError ────────────────────────────────────────────\n\n/**\n * Detail for `RuntimeErrorCode 'equirect-projection-failed'`.\n *\n * Emitted when the equirect-to-cubemap IBL projection fails for the equirect\n * handle referenced by a `Skylight` / `SkyboxBackground` component. The handle\n * id is carried so AI users can trace which equirect source failed projection.\n * Degradation: the record arm records `status:'failed'`, binds the white-cube\n * fallback, fires this error ONCE, and does NOT retry the projection.\n *\n * feat-20260630 D-5: structured error with detail carrying the handle id.\n */\nexport interface EquirectProjectionFailedDetail {\n readonly handle: number;\n}\n\n/**\n * Structured error for a failed equirect-to-cubemap IBL projection.\n *\n * Emitted by the record stage when the internal cubemap projection for an\n * equirect handle returns a failure (or records `status:'failed'`). Four-field\n * surface per AGENTS.md error model:\n * - `.code = 'equirect-projection-failed'` (closed RuntimeErrorCode)\n * - `.expected` — equirect-to-cubemap projection + IBL precompute succeeds\n * - `.hint` — declare `Skylight{equirect}` with a valid HDR equirect source;\n * check `device.caps.rgba16floatRenderable`. The projection is internal —\n * there is no user upload call to retry\n * - `.detail = { handle }` — the numeric equirect handle id for diagnostics\n */\nexport class EquirectProjectionFailedError extends Error {\n readonly code = 'equirect-projection-failed' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: EquirectProjectionFailedDetail;\n\n constructor(handle: number) {\n const expected = `equirect handle ${handle} projects to a GPU cubemap + IBL precompute`;\n const hint =\n `equirect handle ${handle} referenced by Skylight/SkyboxBackground failed projection; ` +\n `declare Skylight{equirect} with a valid HDR equirect source and check device.caps.rgba16floatRenderable. ` +\n `The projection is internal (no user upload call); the record arm does not retry`;\n super(`equirect handle ${handle} cubemap projection failed`);\n this.name = 'EquirectProjectionFailedError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { handle };\n }\n}\n\n// ── HdrpLightBudgetExceededError ───────────────────────────────────────────\n\n/**\n * Detail for `RuntimeErrorCode 'hdrp-light-budget-exceeded'`.\n *\n * Emitted per-frame (once-per-frame fire) when light count exceeds HDRP budget.\n */\nexport interface HdrpLightBudgetExceededDetail {\n readonly actual: number;\n readonly budget: number;\n}\n\n/**\n * Structured error for HDRP light budget exceeded (AC-06/AC-07).\n *\n * Emitted per-frame in recordFrame when the total punctual light count\n * exceeds the HDRP budget (256). Fail-soft: fire once per frame, truncate to 256.\n * - `.code = 'hdrp-light-budget-exceeded'` (closed RuntimeErrorCode)\n * - `.expected` — 'light count <= 256'\n * - `.hint` — 'reduce world light count or increase budget (OOS-hdrp-larger-budget)'\n * - `.detail = { actual, budget }`\n */\nexport class HdrpLightBudgetExceededError extends Error {\n readonly code = 'hdrp-light-budget-exceeded' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: HdrpLightBudgetExceededDetail;\n\n constructor(actual: number, budget: number) {\n const expected = `light count <= ${budget}`;\n const hint =\n `${actual} lights exceed HDRP budget ${budget}; ` +\n 'truncating to 256. Reduce light count or wait for OOS-hdrp-larger-budget';\n super(`HDRP light budget exceeded: ${actual} > ${budget}`);\n this.name = 'HdrpLightBudgetExceededError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { actual, budget };\n }\n}\n\n// ── HdrpIndexListOverflowError ─────────────────────────────────────────────\n\n/**\n * Detail for `RuntimeErrorCode 'hdrp-index-list-overflow'`.\n *\n * Emitted per-frame (once-per-frame fire) when the cluster binner overflows\n * the light index list capacity (65536). Upgraded from ClusterBinError.\n */\nexport interface HdrpIndexListOverflowDetail {\n readonly actual: number;\n readonly capacity: number;\n}\n\n/**\n * Structured error for HDRP cluster binner index list overflow (AC-24).\n *\n * Emitted per-frame in recordFrame when the CPU binner returns\n * `ClusterBinError('index-overflow')`. Fail-soft: fire once per frame,\n * continue rendering with what fit.\n * - `.code = 'hdrp-index-list-overflow'` (closed RuntimeErrorCode)\n * - `.expected` — 'light index list entries <= 65536'\n * - `.hint` — 'reduce lights, shrink cluster grid, or increase capacity'\n * - `.detail = { actual, capacity }`\n */\nexport class HdrpIndexListOverflowError extends Error {\n readonly code = 'hdrp-index-list-overflow' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: HdrpIndexListOverflowDetail;\n\n constructor(actual: number, capacity: number) {\n const expected = `light index list entries <= ${capacity}`;\n const hint =\n `cluster binner overflow: writeCount ${actual} exceeds capacity ${capacity}; ` +\n 'reduce lights, shrink cluster grid, or increase LIGHT_INDEX_LIST_CAPACITY';\n super(`HDRP index list overflow: ${actual} > ${capacity}`);\n this.name = 'HdrpIndexListOverflowError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { actual, capacity };\n }\n}\n\n// ── HdrpDeferredCapsInsufficientError ──────────────────────────────────────\n\n/**\n * Detail for `RuntimeErrorCode 'hdrp-deferred-caps-insufficient'`.\n *\n * Emitted when the Standard clustered lane has fewer than 4 color attachments,\n * meaning the deferred path cannot allocate 3 g-buffer color targets + depth.\n */\nexport interface HdrpDeferredCapsInsufficientDetail {\n readonly actual: number;\n readonly expected: number;\n}\n\n/**\n * Structured error for deferred-path capability gate failure.\n *\n * Emitted during Standard clustered lane validation — synchronous throw.\n * - `.code = 'hdrp-deferred-caps-insufficient'` (closed RuntimeErrorCode)\n * - `.expected` — 'maxColorAttachments >= 4'\n * - `.hint` — actionable guidance to upgrade browser or select URP\n * - `.detail = { actual, expected }`\n *\n * @see plan-strategy D-5 (capability validation, no silent fallback)\n */\nexport class HdrpDeferredCapsInsufficientError extends Error {\n readonly code = 'hdrp-deferred-caps-insufficient' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: HdrpDeferredCapsInsufficientDetail;\n\n constructor(actual: number) {\n const _expected = 4;\n const _expectedStr = `maxColorAttachments >= ${_expected}`;\n const hint =\n `WebGPU maxColorAttachments = ${actual} (need >= ${_expected}). ` +\n 'Upgrade browser to latest Chrome/Edge/Safari, or use URP (forgeax::urp) instead of HDRP.';\n super(\n `HDRP deferred caps insufficient: maxColorAttachments = ${actual} (need >= ${_expected})`,\n );\n this.name = 'HdrpDeferredCapsInsufficientError';\n this.expected = _expectedStr;\n this.hint = hint;\n this.detail = { actual, expected: _expected };\n }\n}\n\n// ── PointShadowAtlasUninitializedError ─────────────────────────────────────\n\n/**\n * Structured error for `ShadowAtlas.faceView` called before `ensure()`\n * allocated the cube_array texture. Replaces the prior bare\n * `throw new Error()` (Round-2 F-4: P3 closed-union compliance).\n *\n * - `.code = 'point-shadow-atlas-uninitialized'`\n * - `.expected` — call `ensure()` before iterating face views\n * - `.hint` — gate `faceView` on `isAllocated()` or call `ensure()` once\n * in the per-frame extract step before recording the 6 x N caster passes\n * - `.detail = undefined` (no per-call data needed)\n */\nexport class PointShadowAtlasUninitializedError extends Error {\n readonly code = 'point-shadow-atlas-uninitialized' as const;\n readonly expected: string;\n readonly hint: string;\n\n constructor() {\n const expected = 'ShadowAtlas.ensure() invoked before faceView()';\n const hint =\n 'Gate faceView on isAllocated() or call ensure() once in the per-frame extract step before iterating face views';\n super('ShadowAtlas.faceView called before ensure(); the cube_array texture is not allocated');\n this.name = 'PointShadowAtlasUninitializedError';\n this.expected = expected;\n this.hint = hint;\n }\n}\n\n// ── PointShadowAtlasBoundsViolationError ───────────────────────────────────\n\n/**\n * Detail for `RuntimeErrorCode 'point-shadow-atlas-bounds-violation'`.\n *\n * Emitted by `ShadowAtlas.faceView` when `layer` falls outside `[0, layers)`\n * or `face` falls outside `[0, 6)`. Both axes are reported as\n * `{ axis, value, max }` so AI users discriminate without parsing the message.\n */\nexport interface PointShadowAtlasBoundsViolationDetail {\n readonly axis: 'layer' | 'face';\n readonly value: number;\n readonly max: number;\n}\n\n/**\n * Structured error for `ShadowAtlas.faceView(layer, face)` arguments outside\n * the allocated atlas range. Replaces the prior bare `throw new Error()`\n * (Round-2 F-4: P3 closed-union compliance).\n *\n * - `.code = 'point-shadow-atlas-bounds-violation'`\n * - `.expected` — `0 <= layer < layers && 0 <= face < 6`\n * - `.hint` — clamp `shadowAtlasLayer` or face index before calling\n * `faceView`; the cap on layers is `PointLightShadow` cardinality (4)\n * - `.detail = { axis, value, max }` — discriminates layer vs face\n */\nexport class PointShadowAtlasBoundsViolationError extends Error {\n readonly code = 'point-shadow-atlas-bounds-violation' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: PointShadowAtlasBoundsViolationDetail;\n\n constructor(axis: 'layer' | 'face', value: number, max: number) {\n const expected = `0 <= ${axis} < ${max}`;\n const hint =\n axis === 'layer'\n ? `clamp PointLight.shadowAtlasLayer to [0, ${max}); the cap on layers equals PointLightShadow cardinality (4)`\n : `clamp face index to [0, ${max}); cube faces are indexed 0..5 in +X/-X/+Y/-Y/+Z/-Z order`;\n super(`ShadowAtlas.faceView ${axis} out of range: ${value} (must be in [0, ${max}))`);\n this.name = 'PointShadowAtlasBoundsViolationError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { axis, value, max };\n }\n}\n\n// ── VideoUploadUnsupportedError ─────────────────────────────────────────\n\n/**\n * Structured error for `RuntimeErrorCode 'video-upload-unsupported'`\n * (feat-20260623-world-space-video-asset M3 / w11 — AC-10).\n *\n * Fired by the per-frame record stage (`videoTextureView`) when a VideoPlayer\n * entity can reach neither video upload path this frame: the general\n * `copyExternalImageToTexture` path (no host HTMLVideoElement resolved via\n * `VideoElementProvider`) AND the high-perf `GPUExternalTexture` path\n * (capability absent). The engine surfaces this explicit failure rather than\n * silently rendering a stale/garbage texture (charter P3, plan-strategy D-6).\n * - `.code = 'video-upload-unsupported'`\n * - `.expected` — at least one upload path available (host element or\n * GPUExternalTexture capability)\n * - `.hint` — actionable recovery: use a static texture or switch backend\n * - `.detail` — undefined (no narrowed detail variant)\n */\nexport class VideoUploadUnsupportedError extends Error {\n readonly code = 'video-upload-unsupported' as const;\n readonly expected: string;\n readonly hint: string;\n\n constructor() {\n const expected =\n 'at least one video upload path available: a host HTMLVideoElement (general copyExternalImageToTexture path) or GPUExternalTexture capability (high-perf path)';\n const hint =\n 'this backend exposes no usable video upload path; render a static texture instead, or switch to a WebGPU backend that supports video texture upload';\n super('video upload unsupported — no general or high-perf path available');\n this.name = 'VideoUploadUnsupportedError';\n this.expected = expected;\n this.hint = hint;\n }\n}\n\n// ── VertexStorageBufferUnavailableError ─────────────────────────────────\n\n/**\n * Structured error for missing vertex-stage storage buffer capability.\n *\n * Emitted at createRenderer time (cap-gate).\n * - `.code = 'vertex-storage-buffer-unavailable'`\n * - `.expected` — device.caps supports vertex-stage storage buffer\n * - `.hint` — switch to a WebGPU adapter with vertex storage buffer support or use uniform-buffer fallback (OOS-uniform-palette)\n * - `.detail` — undefined (no narrowed detail variant)\n */\nexport class VertexStorageBufferUnavailableError extends Error {\n readonly code = 'vertex-storage-buffer-unavailable' as const;\n readonly expected: string;\n readonly hint: string;\n\n constructor() {\n const expected =\n 'device.caps supports vertex-stage storage buffer (maxStorageBuffersPerShaderStage >= 1)';\n const hint =\n 'this device does not support vertex-stage storage buffers; skinning requires vertex-stage storage buffer access (OOS-uniform-palette fallback not implemented)';\n super('vertex-stage storage buffer unavailable — skinning cannot operate');\n this.name = 'VertexStorageBufferUnavailableError';\n this.expected = expected;\n this.hint = hint;\n }\n}\n\n// ── VertexColorVariantConflictError ───────────────────────────────────────\n\nexport interface VertexColorVariantConflictDetail {\n readonly authored: true;\n readonly authoredValue: string;\n readonly projected: boolean;\n}\n\n/** The authored color axis disagrees with the canonical geometry projection. */\nexport class VertexColorVariantConflictError extends Error {\n readonly code = 'vertex-color-variant-conflict' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: VertexColorVariantConflictDetail;\n\n constructor(authoredValue: string, projected: boolean) {\n const expected = `VERTEX_COLOR_AVAILABLE=${projected ? 'true' : 'false'}`;\n const hint =\n 'derive the shader variant from the mesh VertexLayoutProjection; COLOR_0 presence is a geometry fact';\n super(`authored vertex-color variant ${authoredValue} disagrees with projected ${expected}`);\n this.name = 'VertexColorVariantConflictError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { authored: true, authoredValue, projected };\n }\n}\n\n// ── Skin palette/material validation errors ────────────────────────────────\n\n/** Detail for a palette buffer that exceeds the device storage limit. */\nexport interface SkinPaletteOverflowDetail {\n readonly requestedBytes: number;\n readonly limit: number;\n}\n\n/**\n * Structured render error for a skin palette allocation that exceeds the\n * device storage-buffer binding limit. The allocator that emits this error\n * lives in render, so the error belongs to the render union rather than the\n * renderer-independent skinning binding package.\n */\nexport class SkinPaletteOverflowError extends Error {\n readonly code = 'skin-palette-overflow' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: SkinPaletteOverflowDetail;\n\n constructor(requestedBytes: number, limit: number) {\n const expected = `skinned joint palette (${requestedBytes} B) fits within device.limits.maxStorageBufferBindingSize (${limit} B)`;\n const hint =\n 'palette buffer exceeds device maxStorageBufferBindingSize; reduce skinned entity count or split into multiple palette buffers (OOS-skin-palette-batch)';\n super(`skin palette buffer needs ${requestedBytes} B, exceeds device limit ${limit} B`);\n this.name = 'SkinPaletteOverflowError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { requestedBytes, limit };\n }\n}\n\n/** Detail for a skinned entity using a non-skin material shader. */\nexport interface SkinMaterialMismatchDetail {\n readonly entity: number;\n readonly actualShader: string | undefined;\n}\n\n/** Structured render error for a Skin/non-skin-material mismatch. */\nexport class SkinMaterialMismatchError extends Error {\n readonly code = 'skin-material-mismatch' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: SkinMaterialMismatchDetail;\n\n constructor(entity: number, actualShader: string | undefined) {\n const expected = \"Skin entity's first material program module === 'forgeax::pbr-skin'\";\n const hint = `entity ${entity} has Skin but the first material program module is ${actualShader ?? '<empty>'}; load the mesh via the gltf importer (cooker auto-routes 'forgeax::pbr-skin' for skinned primitives), or remove the Skin component to render the entity unskinned with Materials.standard / Materials.unlit`;\n super(\n `Skin / material mismatch on entity ${entity}: expected forgeax::pbr-skin, got ${actualShader ?? '<empty>'}`,\n );\n this.name = 'SkinMaterialMismatchError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { entity, actualShader };\n }\n}\n\n/** Detail for a pbr-skin material whose mesh lacks skin attributes. */\nexport interface MaterialSkinAttrMissingDetail {\n readonly entity: number;\n readonly missing: 'skinIndex' | 'skinWeight' | 'both';\n}\n\n/** Structured render error for a pbr-skin material/mesh attribute mismatch. */\nexport class MaterialSkinAttrMissingError extends Error {\n readonly code = 'material-skin-attr-missing' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: MaterialSkinAttrMissingDetail;\n\n constructor(entity: number, missing: 'skinIndex' | 'skinWeight' | 'both') {\n const expected = 'pbr-skin material requires mesh.attributes.skinIndex + skinWeight';\n const hint = `entity ${entity} uses forgeax::pbr-skin but its MeshAsset is missing ${missing}; switch the entity to a skinned glTF mesh authored with JOINTS_0 + WEIGHTS_0, or change the material to a non-skin shader via Materials.standard / Materials.unlit`;\n super(\n `material/skin attribute mismatch on entity ${entity}: pbr-skin material with mesh missing ${missing}`,\n );\n this.name = 'MaterialSkinAttrMissingError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { entity, missing };\n }\n}\n\nexport interface TransmissionCapabilityMissingDetail {\n readonly material: string;\n readonly capability: 'transmission';\n readonly stage: 'prepare' | 'record';\n readonly lane: 'standard-forward';\n readonly format: string;\n readonly missing: readonly TransmissionCapabilityFact[];\n}\n\nexport class TransmissionCapabilityMissingError extends Error {\n readonly code = 'transmission-capability-missing' as const;\n readonly expected = 'the renderer exposes the transmission capability for this material';\n readonly hint = 'disable transmission or provide the renderer capability before drawing';\n readonly detail: TransmissionCapabilityMissingDetail;\n\n constructor(\n material: string,\n stage: 'prepare' | 'record',\n evidence: {\n readonly lane: 'standard-forward';\n readonly format: string;\n readonly missing: readonly TransmissionCapabilityFact[];\n },\n ) {\n super(`transmission capability is missing for material '${material}'`);\n this.name = 'TransmissionCapabilityMissingError';\n this.detail = { material, capability: 'transmission', stage, ...evidence };\n }\n}\n\n// -- RenderFeature errors ---------------------------------------------------\n\nexport type RenderFeatureErrorCode =\n | 'render-feature-registration-conflict'\n | 'render-feature-stage-failed'\n | 'render-feature-capability-missing'\n | 'render-feature-pass-order-conflict'\n | 'render-feature-preparation-failed'\n | 'render-feature-prepared-state-mismatch'\n | 'render-feature-draw-recording-failed';\n\nexport interface RenderFeatureRegistrationConflictDetail {\n readonly featureIdentity: string;\n readonly order: number;\n readonly conflictingOrder: number;\n}\n\nexport interface RenderFeatureCleanupFailure {\n readonly featureIdentity: string;\n readonly order: number;\n readonly code: string;\n}\n\nexport interface RenderFeatureStageFailedDetail {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: RenderFeatureStage;\n readonly recovery: RenderFeatureRecovery;\n readonly cleanupFailures?: readonly RenderFeatureCleanupFailure[];\n}\n\nexport interface RenderFeatureCapabilityMissingDetail {\n readonly featureIdentity: string;\n readonly order: number;\n readonly capability: RenderFeatureCapabilityKey;\n}\n\nexport interface RenderFeaturePassOrderConflictDetail {\n readonly featureIdentity: string;\n readonly order: number;\n readonly passIdentity: string;\n readonly dependencyIdentity: string;\n}\n\nexport interface RenderFeaturePreparationFailedDetail {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: 'prepare';\n readonly operation: string;\n readonly resourceKind: PreparedKind;\n readonly resourceName: string;\n readonly reason: string;\n readonly recovery: RenderFeatureRecovery;\n}\n\nexport type RenderFeaturePreparedStateMismatchDetail =\n | {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: 'contribute';\n readonly operation: string;\n readonly resourceKind: PreparedKind;\n readonly reason: 'missing-prepared-state';\n readonly missingResource: string;\n readonly recovery: RenderFeatureRecovery;\n }\n | {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: 'contribute';\n readonly operation: string;\n readonly resourceKind: PreparedKind;\n readonly reason: 'foreign-feature';\n readonly expectedFeatureIdentity: string;\n readonly actualFeatureIdentity: string;\n readonly recovery: RenderFeatureRecovery;\n }\n | {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: 'contribute';\n readonly operation: string;\n readonly resourceKind: PreparedKind;\n readonly reason: 'foreign-kind';\n readonly expectedKind: PreparedKind;\n readonly actualKind: PreparedKind;\n readonly recovery: RenderFeatureRecovery;\n }\n | {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: 'contribute';\n readonly operation: string;\n readonly resourceKind: PreparedKind;\n readonly reason: 'generation-mismatch';\n readonly expectedGeneration: number;\n readonly actualGeneration: number;\n readonly recovery: RenderFeatureRecovery;\n }\n | {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: 'contribute';\n readonly operation: string;\n readonly resourceKind: PreparedKind;\n readonly reason: 'layout-mismatch';\n readonly expectedLayout: string;\n readonly actualLayout: string;\n readonly recovery: RenderFeatureRecovery;\n }\n | {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: 'contribute';\n readonly operation: string;\n readonly resourceKind: PreparedKind;\n readonly reason: 'format-mismatch';\n readonly expectedFormat: string;\n readonly actualFormat: string;\n readonly recovery: RenderFeatureRecovery;\n };\n\nexport interface RenderFeatureDrawRecordingFailedDetail {\n readonly featureIdentity: string;\n readonly order: number;\n readonly stage: 'record';\n readonly operation: string;\n readonly resourceKind: PreparedKind;\n readonly reason: string;\n readonly backendReason: string;\n readonly recovery: RenderFeatureRecovery;\n}\n\nexport type RenderFeatureErrorDetailByCode = {\n 'render-feature-registration-conflict': RenderFeatureRegistrationConflictDetail;\n 'render-feature-stage-failed': RenderFeatureStageFailedDetail;\n 'render-feature-capability-missing': RenderFeatureCapabilityMissingDetail;\n 'render-feature-pass-order-conflict': RenderFeaturePassOrderConflictDetail;\n 'render-feature-preparation-failed': RenderFeaturePreparationFailedDetail;\n 'render-feature-prepared-state-mismatch': RenderFeaturePreparedStateMismatchDetail;\n 'render-feature-draw-recording-failed': RenderFeatureDrawRecordingFailedDetail;\n};\n\n/** Machine-readable four-field diagnostic exposed by every feature error. */\nexport type RenderFeatureErrorDescriptor = {\n [Code in RenderFeatureErrorCode]: {\n readonly code: Code;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderFeatureErrorDetailByCode[Code];\n };\n}[RenderFeatureErrorCode];\n\nconst renderFeatureRecoveryHintByRecovery = {\n 'next-frame': (featureIdentity: string, stage: RenderFeatureStage) =>\n `correct '${featureIdentity}' ${stage} data and retry on the next frame`,\n 'renderer-recover': (featureIdentity: string, _stage: RenderFeatureStage) =>\n `wait for renderer recovery before retrying '${featureIdentity}'`,\n registration: (featureIdentity: string, _stage: RenderFeatureStage) =>\n `correct '${featureIdentity}' registration before retrying`,\n} satisfies Record<\n RenderFeatureRecovery,\n (featureIdentity: string, stage: RenderFeatureStage) => string\n>;\n\nexport class RenderFeatureRegistrationConflictError extends Error {\n readonly code = 'render-feature-registration-conflict' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderFeatureRegistrationConflictDetail;\n\n constructor(featureIdentity: string, order: number, conflictingOrder: number) {\n const expected = `feature identity '${featureIdentity}' is unique`;\n const hint = `rename '${featureIdentity}' or remove the duplicate feature before registration`;\n super(`render feature registration conflict for '${featureIdentity}'`);\n this.name = 'RenderFeatureRegistrationConflictError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { featureIdentity, order, conflictingOrder };\n }\n}\n\nexport class RenderFeatureStageFailedError extends Error {\n readonly code = 'render-feature-stage-failed' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderFeatureStageFailedDetail;\n\n constructor(\n featureIdentity: string,\n order: number,\n stage: RenderFeatureStage,\n recovery: RenderFeatureRecovery,\n ) {\n const expected = `feature '${featureIdentity}' completes its ${stage} stage without an error`;\n const hint = renderFeatureRecoveryHintByRecovery[recovery](featureIdentity, stage);\n super(`render feature '${featureIdentity}' failed during ${stage}`);\n this.name = 'RenderFeatureStageFailedError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { featureIdentity, order, stage, recovery };\n }\n}\n\nexport class RenderFeatureCapabilityMissingError extends Error {\n readonly code = 'render-feature-capability-missing' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderFeatureCapabilityMissingDetail;\n\n constructor(\n featureIdentity: string,\n order: number,\n capability: RenderFeatureCapabilityMissingDetail['capability'],\n ) {\n const expected = `device capability '${capability}' is available for feature '${featureIdentity}'`;\n const hint = `disable '${featureIdentity}' or use a device with '${capability}' capability`;\n super(`render feature '${featureIdentity}' requires missing capability '${capability}'`);\n this.name = 'RenderFeatureCapabilityMissingError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { featureIdentity, order, capability };\n }\n}\n\nexport class RenderFeaturePassOrderConflictError extends Error {\n readonly code = 'render-feature-pass-order-conflict' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderFeaturePassOrderConflictDetail;\n\n constructor(\n featureIdentity: string,\n order: number,\n passIdentity: string,\n dependencyIdentity: string,\n ) {\n const expected = `feature pass '${passIdentity}' follows dependency '${dependencyIdentity}'`;\n const hint = `reorder '${featureIdentity}' passes so '${passIdentity}' follows '${dependencyIdentity}'`;\n super(`render feature '${featureIdentity}' pass order conflict`);\n this.name = 'RenderFeaturePassOrderConflictError';\n this.expected = expected;\n this.hint = hint;\n this.detail = { featureIdentity, order, passIdentity, dependencyIdentity };\n }\n}\n\nexport class RenderFeaturePreparationFailedError extends Error {\n readonly code = 'render-feature-preparation-failed' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderFeaturePreparationFailedDetail;\n\n constructor(\n featureIdentity: string,\n order: number,\n operation: string,\n resourceKind: RenderFeaturePreparationFailedDetail['resourceKind'],\n resourceName: string,\n reason: string,\n recovery: RenderFeatureRecovery,\n ) {\n const expected = `${resourceKind} '${resourceName}' is prepared during ${operation}`;\n const hint = `repair '${resourceName}' and retry feature '${featureIdentity}' on ${recovery}`;\n super(`render feature '${featureIdentity}' preparation failed for '${resourceName}'`);\n this.name = 'RenderFeaturePreparationFailedError';\n this.expected = expected;\n this.hint = hint;\n this.detail = {\n featureIdentity,\n order,\n stage: 'prepare',\n operation,\n resourceKind,\n resourceName,\n reason,\n recovery,\n };\n }\n}\n\nexport class RenderFeaturePreparedStateMismatchError extends Error {\n readonly code = 'render-feature-prepared-state-mismatch' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderFeaturePreparedStateMismatchDetail;\n\n constructor(detail: RenderFeaturePreparedStateMismatchDetail) {\n const expected = `${detail.resourceKind} state is compatible for '${detail.operation}'`;\n const hint = `repair '${detail.reason}' for feature '${detail.featureIdentity}' and retry`;\n super(`render feature '${detail.featureIdentity}' prepared state mismatch`);\n this.name = 'RenderFeaturePreparedStateMismatchError';\n this.expected = expected;\n this.hint = hint;\n this.detail = detail;\n }\n}\n\nexport class RenderFeatureDrawRecordingFailedError extends Error {\n readonly code = 'render-feature-draw-recording-failed' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RenderFeatureDrawRecordingFailedDetail;\n\n constructor(\n featureIdentity: string,\n order: number,\n operation: string,\n resourceKind: RenderFeatureDrawRecordingFailedDetail['resourceKind'],\n reason: string,\n backendReason: string,\n recovery: RenderFeatureRecovery,\n ) {\n const expected = `${resourceKind} recording succeeds for '${operation}'`;\n const hint = `repair '${reason}' and retry feature '${featureIdentity}' after ${recovery}`;\n super(`render feature '${featureIdentity}' draw recording failed`);\n this.name = 'RenderFeatureDrawRecordingFailedError';\n this.expected = expected;\n this.hint = hint;\n this.detail = {\n featureIdentity,\n order,\n stage: 'record',\n operation,\n resourceKind,\n reason,\n backendReason,\n recovery,\n };\n }\n}\n\n// ── ObservationUnavailableError ───────────────────────────────────────────\n\nexport type ObservationUnavailableReason =\n | 'no-frame'\n | 'resource'\n | 'copy-src'\n | 'stale'\n | 'identity'\n | 'format'\n | 'readback-failed';\n\nexport interface ObservationUnavailableDetail {\n readonly reason: ObservationUnavailableReason;\n readonly recovery: 'draw-current-frame' | 'enable-copy-src' | 'retry-readback';\n}\n\n/** A producer-owned current-frame observation could not be made available. */\nexport class ObservationUnavailableError extends Error {\n readonly code = 'observation-unavailable' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: ObservationUnavailableDetail;\n\n constructor(reason: ObservationUnavailableReason, hint: string) {\n let recovery: ObservationUnavailableDetail['recovery'];\n if (reason === 'copy-src') recovery = 'enable-copy-src';\n else if (reason === 'resource' || reason === 'readback-failed') recovery = 'retry-readback';\n else recovery = 'draw-current-frame';\n super(`current-frame observation unavailable: ${reason}`);\n this.name = 'ObservationUnavailableError';\n this.expected = 'a fresh producer-owned rgba16float current-frame observation';\n this.hint = hint;\n this.detail = { reason, recovery };\n }\n}\n\nexport type SceneDataUnavailableReason =\n | 'capability-missing'\n | 'producer-missing'\n | 'coverage-incomplete'\n | 'renderer-recovering';\nexport interface SceneDataUnavailableDetail {\n readonly featureIdentity: string;\n readonly schema: SceneDataSchemaId;\n readonly lane: SceneDataLane;\n readonly reason: SceneDataUnavailableReason;\n readonly missingContributorIds: readonly string[];\n readonly omittedMissingContributorCount: number;\n readonly recovery: 'enable-capability' | 'next-frame' | 'renderer-recover';\n}\nexport class SceneDataUnavailableError extends Error {\n readonly code = 'scene-data-unavailable' as const;\n readonly expected = 'the requested semantic scene data is available for the active plan';\n readonly hint: string;\n readonly detail: SceneDataUnavailableDetail;\n constructor(detail: SceneDataUnavailableDetail) {\n const hint =\n detail.recovery === 'enable-capability'\n ? 'enable rgba16floatRenderable and retry the current frame'\n : detail.recovery === 'renderer-recover'\n ? 'wait for renderer recovery, then retry the frame'\n : 'restore the producer coverage and retry on the next frame';\n super(`scene data '${detail.schema}' unavailable for '${detail.featureIdentity}'`);\n this.name = 'SceneDataUnavailableError';\n this.hint = hint;\n this.detail = Object.freeze({\n ...detail,\n missingContributorIds: Object.freeze([...detail.missingContributorIds].slice(0, 32)),\n omittedMissingContributorCount: Math.max(\n detail.omittedMissingContributorCount,\n Math.max(0, detail.missingContributorIds.length - 32),\n ),\n });\n }\n}\n\nexport class TaaUnavailableError extends Error {\n readonly code = 'taa-unavailable' as const;\n readonly expected =\n 'Standard TAA has a renderable rgba16float target and a complete resolve path';\n readonly hint =\n 'enable rgba16float rendering or select none/fxaa explicitly; do not treat TAA as no-AA';\n readonly detail: {\n readonly reason: 'capability' | 'topology' | 'history';\n readonly observed?: string;\n };\n constructor(reason: 'capability' | 'topology' | 'history', observed?: string) {\n super(`taa-unavailable: ${reason}`);\n this.name = 'TaaUnavailableError';\n this.detail = observed === undefined ? { reason } : { reason, observed };\n }\n}\n\nexport interface FrameReceiptStaleDetail {\n readonly frameId: number;\n readonly receiptGeneration: number;\n readonly currentGeneration: number;\n}\n\n/** Receipt-bound observation failed closed at a generation fence. */\nexport class FrameReceiptStaleError extends Error {\n readonly code = 'frame-receipt-stale' as const;\n readonly expected = 'the observation receipt belongs to the active device generation';\n readonly hint = 'draw a new frame and call observe with its returned FrameReceipt';\n readonly detail: FrameReceiptStaleDetail;\n\n constructor(detail: FrameReceiptStaleDetail) {\n super('frame receipt belongs to a retired device generation');\n this.name = 'FrameReceiptStaleError';\n this.detail = detail;\n }\n}\n\nexport interface RendererContractFailureDetail {\n readonly operation: 'construct' | 'attach' | 'draw' | 'observe';\n readonly cause: string;\n}\n\n/** Structured boundary failure while adapting an owner contract. */\nexport class RendererContractFailureError extends Error {\n readonly code = 'renderer-contract-failed' as const;\n readonly expected = 'renderer owner contracts remain valid at the public boundary';\n readonly hint = 'repair the owner contract and retry the operation';\n readonly detail: RendererContractFailureDetail;\n\n constructor(operation: RendererContractFailureDetail['operation'], cause: string) {\n super(`renderer ${operation} contract failed: ${cause}`);\n this.name = 'RendererContractFailureError';\n this.detail = { operation, cause };\n }\n}\n\nexport interface EnvironmentSourceConflictDetail {\n readonly owners: readonly {\n readonly kind: 'image' | 'atmosphere';\n readonly entityKey: number;\n readonly sourceKey: string;\n }[];\n}\n\nexport class EnvironmentSourceConflictError extends Error {\n readonly code = 'environment-source-conflict' as const;\n readonly expected = 'exactly one environment source owns the frame';\n readonly hint = 'remove all but one image or atmosphere environment owner';\n readonly detail: EnvironmentSourceConflictDetail;\n\n constructor(owners: readonly EnvironmentSourceConflictDetail['owners'][number][]) {\n super('environment source owners conflict');\n this.name = 'EnvironmentSourceConflictError';\n this.detail = { owners: owners.map((owner) => Object.freeze({ ...owner })) };\n }\n}\n\nexport interface FogCardinalityDetail {\n readonly count: number;\n}\n\nexport class FogCardinalityError extends Error {\n readonly code = 'fog-cardinality' as const;\n readonly expected = 'zero or one Fog owner contributes to a frame';\n readonly hint = 'remove extra Fog owners so the resource owner has at most one';\n readonly detail: FogCardinalityDetail;\n\n constructor(count: number) {\n super(`Fog owner cardinality is ${count}`);\n this.name = 'FogCardinalityError';\n this.detail = { count };\n }\n}\n\nexport interface TaaCapsInsufficientDetail {\n readonly required: readonly string[];\n readonly available: readonly string[];\n}\n\nexport class TaaCapsInsufficientError extends Error {\n readonly code = 'taa-caps-insufficient' as const;\n readonly expected = 'the backend exposes the capabilities required by TAA';\n readonly hint = 'select a backend with the required TAA capabilities or disable TAA on Camera';\n readonly detail: TaaCapsInsufficientDetail;\n\n constructor(required: readonly string[], available: readonly string[]) {\n super('TAA capabilities are insufficient');\n this.name = 'TaaCapsInsufficientError';\n this.detail = { required: [...required], available: [...available] };\n }\n}\n\nexport interface EnvironmentGenerationFailedDetail {\n readonly sourceKey: string;\n readonly stage: 'prepare' | 'build' | 'execute' | 'finish' | 'submit';\n}\n\nexport class EnvironmentGenerationFailedError extends Error {\n readonly code = 'environment-generation-failed' as const;\n readonly expected = 'the selected environment generation completes its owner stage';\n readonly hint = 'inspect the stage and sourceKey, then retry after correcting the environment';\n readonly detail: EnvironmentGenerationFailedDetail;\n\n constructor(sourceKey: string, stage: EnvironmentGenerationFailedDetail['stage']) {\n super(`environment generation failed during ${stage}`);\n this.name = 'EnvironmentGenerationFailedError';\n this.detail = { sourceKey, stage };\n }\n}\n\nexport interface AtmosphereInvalidParameterDetail {\n readonly field: string;\n readonly value: number;\n}\n\nexport interface AtmosphereParameterRange {\n readonly min: number;\n readonly max: number;\n}\n\nexport class AtmosphereInvalidParameterError extends Error {\n readonly code = 'atmosphere-invalid-parameter' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: AtmosphereInvalidParameterDetail;\n\n constructor(field: string, value: number, range: AtmosphereParameterRange) {\n super(`Atmosphere.${field} is invalid`);\n this.name = 'AtmosphereInvalidParameterError';\n this.detail = { field, value };\n const rangeText = Number.isFinite(range.max)\n ? `[${range.min}, ${range.max}]`\n : `>= ${range.min}`;\n this.expected = `Atmosphere.${field} must be finite and ${rangeText}`;\n this.hint = `set Atmosphere.${field} to a finite value ${rangeText}`;\n }\n}\n\nexport interface OwnerStageFailedDetail {\n readonly owner: 'environment' | 'temporal' | 'fog' | 'renderer';\n readonly stage: 'extract' | 'prepare' | 'record' | 'finish' | 'submit';\n}\n\nexport class OwnerStageFailedError extends Error {\n readonly code = 'owner-stage-failed' as const;\n readonly expected = 'the owner completes its current frame stage';\n readonly hint = 'inspect the owner and stage, keep the last-known-good frame, and retry';\n readonly detail: OwnerStageFailedDetail;\n\n constructor(owner: OwnerStageFailedDetail['owner'], stage: OwnerStageFailedDetail['stage']) {\n super(`${owner} owner failed during ${stage}`);\n this.name = 'OwnerStageFailedError';\n this.detail = { owner, stage };\n }\n}\n\nexport interface RendererOperationCause {\n readonly code: string;\n readonly expected: string;\n readonly hint: string;\n readonly detail?: unknown;\n}\n\nexport interface RendererOperationDetailByCode {\n readonly 'world-lease-invalid': {\n readonly operation: 'attach' | 'draw';\n readonly cause: RendererOperationCause;\n };\n readonly 'frame-input-invalid': {\n readonly operation: 'draw' | 'set-profile';\n readonly cause: RendererOperationCause;\n };\n readonly 'scene-projection-failed': {\n readonly operation: 'draw';\n readonly cause: RendererOperationCause;\n };\n readonly 'asset-binding-failed': {\n readonly operation: 'draw';\n readonly cause: RendererOperationCause;\n };\n readonly 'feature-plan-failed': {\n readonly operation: 'draw';\n readonly cause: RendererOperationCause;\n };\n readonly 'graph-build-failed': {\n readonly operation: 'draw' | 'set-profile';\n readonly cause: RendererOperationCause;\n };\n readonly 'device-operation-failed': {\n readonly operation: 'draw' | 'complete-frame' | 'renderer-event';\n readonly frameId?: number;\n readonly deviceGeneration?: number;\n readonly cause: RendererOperationCause;\n };\n readonly 'surface-unavailable': {\n readonly operation: 'release-surface' | 'restore-surface';\n readonly cause: RendererOperationCause;\n };\n readonly 'renderer-state-invalid': {\n readonly operation: 'draw' | 'set-profile' | 'recover' | 'dispose';\n readonly state: string;\n readonly cause?: RendererOperationCause;\n };\n readonly 'recovery-failed': {\n readonly operation: 'recover';\n readonly oldGeneration: number;\n readonly cause: RendererOperationCause;\n };\n readonly 'cleanup-failed': {\n readonly operation: 'dispose';\n readonly causes: readonly RendererOperationCause[];\n };\n}\n\nexport type RendererOperationErrorCode = keyof RendererOperationDetailByCode;\n\nconst RENDERER_OPERATION_ERROR_POLICY = {\n 'world-lease-invalid': {\n expected: 'every render World is represented by a live lease owned by this Renderer',\n hint: 'attach the World to this Renderer and use the returned lease',\n },\n 'frame-input-invalid': {\n expected: 'the frame input references attached leases and a valid immutable RenderProfile',\n hint: 'repair the frame input and retry draw or setProfile',\n },\n 'scene-projection-failed': {\n expected: 'the attached World projects into the renderer-owned RenderScene',\n hint: 'inspect the structured cause, repair the World publication, and retry draw',\n },\n 'asset-binding-failed': {\n expected: 'all frame assets resolve to valid renderer-owned bindings',\n hint: 'inspect the structured cause, rebuild or cold-cook the asset, and retry draw',\n },\n 'feature-plan-failed': {\n expected: 'every installed RenderFeature produces a valid declarative plan',\n hint: 'inspect the feature cause, repair its plan, and retry draw',\n },\n 'graph-build-failed': {\n expected: 'the Standard graph builds from the active profile and feature plans',\n hint: 'inspect the graph cause, repair the profile or plan, and retry',\n },\n 'device-operation-failed': {\n expected: 'the active device generation completes the renderer-owned operation',\n hint: 'inspect renderer state and the structured cause, then retry or recover',\n },\n 'surface-unavailable': {\n expected: 'the presentation surface accepts the requested lifecycle operation',\n hint: 'inspect renderer state, then restore the surface or create a new Renderer',\n },\n 'renderer-state-invalid': {\n expected: 'the Renderer is in a state that accepts the requested operation',\n hint: 'inspect renderer state and choose retry, restoreSurface, recover, or stop',\n },\n 'recovery-failed': {\n expected: 'one recovery attempt publishes a complete replacement device generation',\n hint: 'inspect the structured cause and retry recover after the host-selected delay',\n },\n 'cleanup-failed': {\n expected: 'Renderer disposal completes every registered cleanup in reverse ownership order',\n hint: 'inspect the ordered cleanup causes; the Renderer remains disposed and must not be reused',\n },\n} as const satisfies Readonly<\n Record<RendererOperationErrorCode, { readonly expected: string; readonly hint: string }>\n>;\n\n/** Public renderer-operation failure with a code-narrowed structured detail. */\nexport class RendererOperationError<Code extends RendererOperationErrorCode> extends Error {\n readonly code: Code;\n readonly expected: string;\n readonly hint: string;\n readonly detail: RendererOperationDetailByCode[Code];\n\n constructor(code: Code, detail: RendererOperationDetailByCode[Code]) {\n const policy = RENDERER_OPERATION_ERROR_POLICY[code];\n super(`${code}: ${policy.expected}`);\n this.name = 'RendererOperationError';\n this.code = code;\n this.expected = policy.expected;\n this.hint = policy.hint;\n this.detail = detail;\n }\n}\n\nexport type RendererExpectedOperationError = {\n readonly [Code in RendererOperationErrorCode]: RendererOperationError<Code>;\n}[RendererOperationErrorCode];\n\n// -- Points/Lines admission errors -------------------------------------------\n\nexport interface PointsLinesInvalidStyleDetail {\n readonly entity: number;\n readonly component: 'Points' | 'Lines' | 'Points/Lines';\n readonly field: string;\n readonly value: number | string | undefined;\n readonly expected: string;\n}\n\nexport class PointsLinesInvalidStyleError extends Error {\n readonly code = 'points-lines-invalid-style' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: PointsLinesInvalidStyleDetail;\n\n constructor(detail: PointsLinesInvalidStyleDetail) {\n super(`invalid ${detail.component} style at ${detail.field}`);\n this.name = 'PointsLinesInvalidStyleError';\n this.expected = detail.expected;\n this.hint = `repair entity ${detail.entity} ${detail.component}.${detail.field} and retry admission`;\n this.detail = detail;\n }\n}\n\nexport interface PointsLinesTopologyMismatchDetail {\n readonly entity: number;\n readonly submesh: number;\n readonly expected: string;\n readonly actual: string;\n}\n\nexport class PointsLinesTopologyMismatchError extends Error {\n readonly code = 'points-lines-topology-mismatch' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: PointsLinesTopologyMismatchDetail;\n\n constructor(detail: PointsLinesTopologyMismatchDetail) {\n super(`Points/Lines topology mismatch at submesh ${detail.submesh}`);\n this.name = 'PointsLinesTopologyMismatchError';\n this.expected = `submesh ${detail.submesh} topology is ${detail.expected}`;\n this.hint = `rebuild entity ${detail.entity} with ${detail.expected} geometry before retrying Points/Lines admission`;\n this.detail = detail;\n }\n}\n\nexport interface PointsLinesStyleUnsupportedDetail {\n readonly lane: string;\n readonly field: string;\n readonly member: string;\n readonly supported: readonly string[];\n}\n\nexport class PointsLinesStyleUnsupportedError extends Error {\n readonly code = 'points-lines-style-unsupported' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: PointsLinesStyleUnsupportedDetail;\n\n constructor(detail: PointsLinesStyleUnsupportedDetail) {\n super(`unsupported Points/Lines ${detail.field} member ${detail.member}`);\n this.name = 'PointsLinesStyleUnsupportedError';\n this.expected = `${detail.field} is one of ${detail.supported.join(', ')}`;\n this.hint = `use a supported Points/Lines ${detail.field} member or wait for a later milestone`;\n this.detail = detail;\n }\n}\n\nexport interface PointsLinesMaterialUnsupportedDetail {\n readonly entity: number;\n readonly material: string;\n readonly pass: string;\n readonly module: string;\n readonly reason: string;\n}\n\nexport class PointsLinesMaterialUnsupportedError extends Error {\n readonly code = 'points-lines-material-unsupported' as const;\n readonly expected = 'one engine-owned unlit forward MaterialAsset pass';\n readonly hint: string;\n readonly detail: PointsLinesMaterialUnsupportedDetail;\n\n constructor(detail: PointsLinesMaterialUnsupportedDetail) {\n super(`Points/Lines material is unsupported on entity ${detail.entity}`);\n this.name = 'PointsLinesMaterialUnsupportedError';\n this.hint = `use Materials.unlit without a shadow-caster pass for entity ${detail.entity}`;\n this.detail = detail;\n }\n}\n\nexport interface PointsLinesBudgetExceededDetail {\n readonly lane: string;\n readonly requested: number;\n readonly limit: number;\n readonly unit: 'points' | 'segments' | 'vertices' | 'indices' | 'bytes' | 'draws';\n}\n\nexport class PointsLinesBudgetExceededError extends Error {\n readonly code = 'points-lines-budget-exceeded' as const;\n readonly expected: string;\n readonly hint: string;\n readonly detail: PointsLinesBudgetExceededDetail;\n\n constructor(detail: PointsLinesBudgetExceededDetail) {\n super(`Points/Lines ${detail.unit} budget exceeded`);\n this.name = 'PointsLinesBudgetExceededError';\n this.expected = `${detail.unit} <= ${detail.limit}`;\n this.hint = `reduce Points/Lines ${detail.unit} or split the entity into bounded equivalent batches`;\n this.detail = detail;\n }\n}\n\nexport interface PointsLinesPrepareFailedDetail {\n readonly owner: string;\n readonly generation: number;\n readonly stage: 'prepare';\n readonly cause: string;\n readonly lastKnownGood: boolean;\n}\n\nexport class PointsLinesPrepareFailedError extends Error {\n readonly code = 'points-lines-prepare-failed' as const;\n readonly expected = 'the complete Points/Lines candidate validates before publication';\n readonly hint: string;\n readonly detail: PointsLinesPrepareFailedDetail;\n\n constructor(detail: PointsLinesPrepareFailedDetail) {\n super(`Points/Lines prepare failed at generation ${detail.generation}`);\n this.name = 'PointsLinesPrepareFailedError';\n this.hint = detail.lastKnownGood\n ? 'retain the last known good candidate, repair the producer, and retry prepare'\n : 'repair the producer and retry prepare; the failed first candidate produces zero draw';\n this.detail = detail;\n }\n}\n\nexport interface VolumeOwnerConflictDetail {\n readonly ownerCount: number;\n}\n\nexport class VolumeOwnerConflictError extends Error {\n readonly code = 'volume-owner-conflict' as const;\n readonly expected = 'exactly one global VolumetricFog owner is authored';\n readonly hint = 'remove additional VolumetricFog owners and retry extraction';\n readonly detail: VolumeOwnerConflictDetail;\n\n constructor(ownerCount: number) {\n super(`volume-owner-conflict: received ${ownerCount} owners`);\n this.name = 'VolumeOwnerConflictError';\n this.detail = { ownerCount };\n }\n}\n\nexport interface VolumeDensityShapeMismatchDetail {\n readonly guid: string;\n readonly viewDimension: string;\n}\n\nexport class VolumeDensityShapeMismatchError extends Error {\n readonly code = 'volume-density-shape-mismatch' as const;\n readonly expected = 'density is a linear 3D TextureAsset';\n readonly hint = 'bind a verified linear texture with viewDimension 3d';\n readonly detail: VolumeDensityShapeMismatchDetail;\n\n constructor(guid: string, viewDimension: string) {\n super(`volume-density-shape-mismatch: ${viewDimension} density is not 3d`);\n this.name = 'VolumeDensityShapeMismatchError';\n this.detail = { guid, viewDimension };\n }\n}\n\nexport interface VolumeInvalidBoundsDetail {\n readonly min: readonly [number, number, number];\n readonly max: readonly [number, number, number];\n}\n\nexport class VolumeInvalidBoundsError extends Error {\n readonly code = 'volume-invalid-bounds' as const;\n readonly expected = 'bounds are finite and max is greater than min on every axis';\n readonly hint = 'set finite non-degenerate volume bounds';\n readonly detail: VolumeInvalidBoundsDetail;\n\n constructor(bounds: VolumeInvalidBoundsDetail) {\n super('volume-invalid-bounds: bounds must be finite and non-degenerate');\n this.name = 'VolumeInvalidBoundsError';\n this.detail = bounds;\n }\n}\n\nexport interface VolumeInvalidParametersDetail {\n readonly field: string;\n readonly value: unknown;\n}\n\nexport class VolumeInvalidParametersError extends Error {\n readonly code = 'volume-invalid-parameters' as const;\n readonly expected = 'volume parameters remain finite and inside their closed ranges';\n readonly hint = 'repair extinction, albedo, emission, anisotropy, or maxDistance';\n readonly detail: VolumeInvalidParametersDetail;\n\n constructor(input: { readonly maxDistance?: number; readonly anisotropy?: number }) {\n const field =\n input.maxDistance !== undefined && input.maxDistance <= 0 ? 'maxDistance' : 'parameters';\n const value = field === 'maxDistance' ? input.maxDistance : input.anisotropy;\n super(`volume-invalid-parameters: ${field} is outside the authored range`);\n this.name = 'VolumeInvalidParametersError';\n this.detail = { field, value };\n }\n}\n\nexport type VolumeError =\n | VolumeOwnerConflictError\n | VolumeDensityShapeMismatchError\n | VolumeInvalidBoundsError\n | VolumeInvalidParametersError;\n\nexport interface ProjectorBindingDetail {\n readonly guid: string;\n readonly status: 'pending' | 'invalid' | 'bind-failed';\n}\n\nexport class ProjectorBindingError extends Error {\n readonly code = 'projector-binding-failed' as const;\n readonly expected = 'authored projector is accepted and bound for both surface and volume';\n readonly hint =\n 'inspect the projector Meta/Pack receipt, repair the source, and retry with the same GUID';\n readonly detail: ProjectorBindingDetail;\n\n constructor(guid: string, status: ProjectorBindingDetail['status']) {\n super(`projector binding failed for ${guid}: ${status}`);\n this.name = 'ProjectorBindingError';\n this.detail = { guid, status };\n }\n}\n\n// -- RenderErrorCode / RenderError closed unions --------------------------------\n\n/**\n * Closed union of render-cluster error codes. AI users perform exhaustive\n * `switch (err.code)` without default; TS guards completeness.\n */\nexport type RenderErrorCode = RenderError['code'];\n\n/**\n * Closed union of the render-cluster structured error classes, each carrying a\n * `RenderErrorCode` discriminant on `.code`.\n */\nexport type RenderError =\n | LifecycleConstructionError\n | RendererExpectedOperationError\n | FrameReceiptStaleError\n | RendererContractFailureError\n | ObservationUnavailableError\n | SceneDataUnavailableError\n | TaaUnavailableError\n | ShadowInvalidConfigError\n | EquirectProjectionFailedError\n | HdrpLightBudgetExceededError\n | HdrpIndexListOverflowError\n | HdrpDeferredCapsInsufficientError\n | PointShadowAtlasUninitializedError\n | PointShadowAtlasBoundsViolationError\n | VideoUploadUnsupportedError\n | VertexStorageBufferUnavailableError\n | VertexColorVariantConflictError\n | SkinPaletteOverflowError\n | SkinMaterialMismatchError\n | MaterialSkinAttrMissingError\n | TransmissionCapabilityMissingError\n | RenderFeatureRegistrationConflictError\n | RenderFeatureStageFailedError\n | RenderFeatureCapabilityMissingError\n | RenderFeaturePassOrderConflictError\n | RenderFeaturePreparationFailedError\n | RenderFeaturePreparedStateMismatchError\n | RenderFeatureDrawRecordingFailedError\n | EnvironmentSourceConflictError\n | FogCardinalityError\n | TaaCapsInsufficientError\n | EnvironmentGenerationFailedError\n | AtmosphereInvalidParameterError\n | OwnerStageFailedError\n | PointsLinesInvalidStyleError\n | PointsLinesTopologyMismatchError\n | PointsLinesStyleUnsupportedError\n | PointsLinesMaterialUnsupportedError\n | PointsLinesBudgetExceededError\n | PointsLinesPrepareFailedError\n | ProjectorBindingError\n | VolumeError;\n","import { type RenderError, RenderFeaturePreparedStateMismatchError } from '../errors/render';\nimport type { RenderFeatureTargetHandle } from '../features/targets';\n\n/** The closed semantic schema namespace published by the render owner. */\nexport const SCENE_DATA_TEMPORAL_V1_SCHEMA = 'forgeax::scene-data::temporal-v1' as const;\nexport type SceneDataSchemaId = typeof SCENE_DATA_TEMPORAL_V1_SCHEMA;\n\nexport type SceneDataLane = 'direct' | 'clustered' | 'cpu-webgl2';\n\nexport interface SceneDataTemporalV1Descriptor {\n readonly schema: typeof SCENE_DATA_TEMPORAL_V1_SCHEMA;\n readonly format: 'rgba16float';\n readonly sampleCount: 1;\n readonly extent: 'render-resolution';\n readonly clearValue: readonly [0, 0, -1, 1];\n readonly channels: Readonly<{\n readonly motionUv: 'rg';\n readonly viewDepth: 'b-log2-1-plus-depth';\n readonly reactive: 'a';\n }>;\n}\n\nexport const SCENE_DATA_TEMPORAL_V1_DESCRIPTOR: SceneDataTemporalV1Descriptor = Object.freeze({\n schema: SCENE_DATA_TEMPORAL_V1_SCHEMA,\n format: 'rgba16float',\n sampleCount: 1,\n extent: 'render-resolution',\n clearValue: [0, 0, -1, 1] as const,\n channels: Object.freeze({\n motionUv: 'rg',\n viewDepth: 'b-log2-1-plus-depth',\n reactive: 'a',\n }),\n});\n\n/** Opaque, sampled-read-only semantic data token. */\nexport interface SceneDataTarget<Schema extends SceneDataSchemaId = SceneDataSchemaId> {\n readonly kind: 'scene-data';\n readonly schema: Schema;\n readonly access: 'sampled-read';\n readonly format: 'rgba16float';\n readonly sampleCount: 1;\n readonly extent: 'render-resolution';\n readonly __sceneDataTarget: unique symbol;\n}\n\nexport type SceneDataTokenMismatch = RenderFeaturePreparedStateMismatchError;\n\nconst targetOwners = new WeakMap<object, SceneDataCatalogIdentity>();\n\nexport interface SceneDataCatalogIdentity {\n readonly featureIdentity: string;\n readonly planIdentity: string;\n readonly generation: number;\n}\n\nexport function registerSceneDataTarget(\n target: SceneDataTarget,\n owner: SceneDataCatalogIdentity,\n): void {\n targetOwners.set(target, owner);\n}\n\nexport function sceneDataTargetOwner(\n target: SceneDataTarget,\n): SceneDataCatalogIdentity | undefined {\n return typeof target === 'object' && target !== null ? targetOwners.get(target) : undefined;\n}\n\nexport function sceneDataTokenMismatch(\n operation: string,\n reason: 'foreign-feature' | 'foreign-kind' | 'generation-mismatch' | 'layout-mismatch',\n owner: SceneDataCatalogIdentity,\n target: Partial<SceneDataTarget> | undefined,\n): SceneDataTokenMismatch {\n const detail =\n reason === 'generation-mismatch'\n ? {\n featureIdentity: owner.featureIdentity,\n order: -1,\n stage: 'contribute' as const,\n operation,\n resourceKind: 'attachment' as const,\n reason,\n expectedGeneration: owner.generation,\n actualGeneration: targetOwners.get(target as object)?.generation ?? -1,\n recovery: 'renderer-recover' as const,\n }\n : reason === 'foreign-feature'\n ? {\n featureIdentity: owner.featureIdentity,\n order: -1,\n stage: 'contribute' as const,\n operation,\n resourceKind: 'attachment' as const,\n reason,\n expectedFeatureIdentity: owner.featureIdentity,\n actualFeatureIdentity: targetOwners.get(target as object)?.featureIdentity ?? 'unknown',\n recovery: 'next-frame' as const,\n }\n : reason === 'foreign-kind'\n ? {\n featureIdentity: owner.featureIdentity,\n order: -1,\n stage: 'contribute' as const,\n operation,\n resourceKind: 'attachment' as const,\n reason,\n expectedKind: 'attachment' as const,\n actualKind: 'pipeline' as const,\n recovery: 'next-frame' as const,\n }\n : {\n featureIdentity: owner.featureIdentity,\n order: -1,\n stage: 'contribute' as const,\n operation,\n resourceKind: 'attachment' as const,\n reason,\n expectedLayout: 'sampled-read-temporal-v1',\n actualLayout: target?.access ?? 'unknown',\n recovery: 'next-frame' as const,\n };\n return new RenderFeaturePreparedStateMismatchError(detail);\n}\n\nexport function isSceneDataTarget(value: unknown): value is SceneDataTarget {\n if (value === null || typeof value !== 'object') return false;\n const candidate = value as Partial<SceneDataTarget>;\n return (\n candidate.kind === 'scene-data' &&\n candidate.schema === SCENE_DATA_TEMPORAL_V1_SCHEMA &&\n candidate.access === 'sampled-read' &&\n candidate.format === 'rgba16float' &&\n candidate.sampleCount === 1 &&\n candidate.extent === 'render-resolution' &&\n targetOwners.has(value)\n );\n}\n\nexport function sceneDataTargetAsAttachment(_target: SceneDataTarget): never {\n throw new TypeError('SceneDataTarget is sampled-read-only and cannot be used as an attachment');\n}\n\nexport type SceneDataTargetInput = RenderFeatureTargetHandle | SceneDataTarget;\n\nexport function sceneDataError(error: SceneDataTokenMismatch): RenderError {\n return error;\n}\n","import { err, ok, type Result } from '@forgeax/engine-types';\nimport type { RenderError } from '../errors/render';\nimport { SceneDataUnavailableError } from '../errors/render';\nimport {\n registerSceneDataTarget,\n SCENE_DATA_TEMPORAL_V1_DESCRIPTOR,\n SCENE_DATA_TEMPORAL_V1_SCHEMA,\n type SceneDataLane,\n type SceneDataSchemaId,\n type SceneDataTarget,\n sceneDataTargetOwner,\n sceneDataTokenMismatch,\n} from './scene-data';\n\nexport type SceneDataAvailability =\n | {\n readonly status: 'available';\n readonly completeness: 'exact' | 'exact-with-reactive-fallback';\n }\n | {\n readonly status: 'unavailable';\n readonly reason:\n | 'capability-missing'\n | 'producer-missing'\n | 'coverage-incomplete'\n | 'renderer-recovering';\n };\n\nexport interface SceneDataInspection {\n readonly schema: SceneDataSchemaId;\n readonly status: SceneDataAvailability['status'];\n readonly generation: number;\n readonly planIdentity: string;\n readonly lane: SceneDataLane;\n readonly completeness?: 'exact' | 'exact-with-reactive-fallback';\n readonly reason?: Exclude<SceneDataAvailability, { status: 'available' }>['reason'];\n readonly missingContributorIds: readonly string[];\n readonly omittedMissingContributorCount: number;\n}\n\nexport interface SceneDataCatalogOptions {\n readonly featureIdentity: string;\n readonly generation: number;\n readonly planIdentity: string;\n readonly lane?: SceneDataLane;\n readonly rgba16floatRenderable: boolean;\n readonly producerPresent?: boolean;\n readonly coverageComplete?: boolean;\n readonly recovering?: boolean;\n readonly reactiveFallback?: boolean;\n readonly missingContributorIds?: readonly string[];\n}\n\nexport interface SceneDataCatalog {\n readonly schema: typeof SCENE_DATA_TEMPORAL_V1_SCHEMA;\n readonly generation: number;\n readonly planIdentity: string;\n readonly availability: SceneDataAvailability;\n require<Schema extends SceneDataSchemaId>(schema: Schema): SceneDataTarget<Schema>;\n validate(target: SceneDataTarget, generation?: number): Result<SceneDataTarget, RenderError>;\n inspect(): SceneDataInspection;\n}\n\nfunction availability(options: SceneDataCatalogOptions): SceneDataAvailability {\n if (options.recovering) return { status: 'unavailable', reason: 'renderer-recovering' };\n if (!options.rgba16floatRenderable)\n return { status: 'unavailable', reason: 'capability-missing' };\n if (options.producerPresent === false)\n return { status: 'unavailable', reason: 'producer-missing' };\n if (options.coverageComplete === false)\n return { status: 'unavailable', reason: 'coverage-incomplete' };\n return {\n status: 'available',\n completeness: options.reactiveFallback ? 'exact-with-reactive-fallback' : 'exact',\n };\n}\n\nfunction createTarget(owner: SceneDataCatalogOptions): SceneDataTarget {\n const target = Object.freeze({\n kind: 'scene-data' as const,\n schema: SCENE_DATA_TEMPORAL_V1_SCHEMA,\n access: 'sampled-read' as const,\n format: 'rgba16float' as const,\n sampleCount: 1 as const,\n extent: 'render-resolution' as const,\n }) as SceneDataTarget;\n registerSceneDataTarget(target, {\n featureIdentity: owner.featureIdentity,\n planIdentity: owner.planIdentity,\n generation: owner.generation,\n });\n return target;\n}\n\nfunction tokenError(catalog: SceneDataCatalogOptions, operation: string): RenderError {\n return sceneDataTokenMismatch(\n operation,\n 'foreign-kind',\n {\n featureIdentity: catalog.featureIdentity,\n planIdentity: catalog.planIdentity,\n generation: catalog.generation,\n },\n undefined,\n );\n}\n\nfunction unavailableError(\n options: SceneDataCatalogOptions,\n reason: Exclude<SceneDataAvailability, { status: 'available' }>['reason'],\n): RenderError {\n const recovery =\n reason === 'capability-missing'\n ? 'enable-capability'\n : reason === 'renderer-recovering'\n ? 'renderer-recover'\n : 'next-frame';\n return new SceneDataUnavailableError({\n featureIdentity: options.featureIdentity,\n schema: SCENE_DATA_TEMPORAL_V1_SCHEMA,\n lane: options.lane ?? 'direct',\n reason,\n missingContributorIds: options.missingContributorIds ?? [],\n omittedMissingContributorCount: 0,\n recovery,\n });\n}\n\nexport function createSceneDataCatalog(options: SceneDataCatalogOptions): SceneDataCatalog {\n const state = availability(options);\n const owner = {\n featureIdentity: options.featureIdentity,\n planIdentity: options.planIdentity,\n generation: options.generation,\n };\n const missing = [...(options.missingContributorIds ?? [])];\n const inspectionBase = {\n schema: SCENE_DATA_TEMPORAL_V1_SCHEMA,\n generation: options.generation,\n planIdentity: options.planIdentity,\n lane: options.lane ?? 'direct',\n missingContributorIds: Object.freeze(missing.slice(0, 32)),\n omittedMissingContributorCount: Math.max(0, missing.length - 32),\n };\n return {\n schema: SCENE_DATA_TEMPORAL_V1_SCHEMA,\n generation: options.generation,\n planIdentity: options.planIdentity,\n availability: state,\n require(schema) {\n if (schema !== SCENE_DATA_TEMPORAL_V1_SCHEMA || state.status !== 'available') {\n if (state.status === 'unavailable') throw unavailableError(options, state.reason);\n throw tokenError(options, 'require scene-data target');\n }\n return createTarget(options) as SceneDataTarget<typeof schema>;\n },\n validate(target, generation = options.generation) {\n const targetOwner = sceneDataTargetOwner(target);\n if (targetOwner === undefined) {\n return err(\n sceneDataTokenMismatch('validate scene-data target', 'foreign-feature', owner, target),\n );\n }\n if (\n targetOwner.planIdentity !== owner.planIdentity ||\n targetOwner.featureIdentity !== owner.featureIdentity\n ) {\n return err(\n sceneDataTokenMismatch('validate scene-data target', 'foreign-feature', owner, target),\n );\n }\n if (generation !== owner.generation || targetOwner.generation !== owner.generation) {\n return err(\n sceneDataTokenMismatch(\n 'validate scene-data target',\n 'generation-mismatch',\n owner,\n target,\n ),\n );\n }\n if (target.access !== 'sampled-read') {\n return err(\n sceneDataTokenMismatch('validate scene-data target', 'layout-mismatch', owner, target),\n );\n }\n return ok(target);\n },\n inspect() {\n return Object.freeze(\n state.status === 'available'\n ? { ...inspectionBase, status: state.status, completeness: state.completeness }\n : { ...inspectionBase, status: state.status, reason: state.reason },\n );\n },\n };\n}\n\nexport { SCENE_DATA_TEMPORAL_V1_SCHEMA } from './scene-data';\nexport { SCENE_DATA_TEMPORAL_V1_DESCRIPTOR };\n","export const STANDARD_PIPELINE_ID = 'forgeax::standard' as const;\nexport const STANDARD_LIGHT_COUNTS = [1, 32, 256] as const;\n/** Shared clustered-lighting facts consumed by pipeline, record, and buffers. */\nexport const DEFAULT_CLUSTER_GRID = { x: 16, y: 9, z: 24 } as const;\nexport const CLUSTER_GRID_STRIDE_U32 = 2;\nexport const LIGHT_INDEX_LIST_CAPACITY = 1048576;\nexport const MAX_LIGHTS = 256;\n\nexport type StandardLightCount = (typeof STANDARD_LIGHT_COUNTS)[number];\nexport type StandardLightingLane = 'direct' | 'clustered';\nexport type StandardFallbackLane = 'native' | 'cpu-webgl2';\nexport type StandardShadowMode = 'off' | 'hard' | 'filtered';\nexport type StandardTone =\n | 'none'\n | 'aces-filmic'\n | 'agx'\n | 'cineon'\n | 'linear'\n | 'neutral'\n | 'reinhard'\n | 'reinhard-extended';\nexport type StandardAntialias = 'none' | 'fxaa' | 'msaa';\nexport const STANDARD_POST_STAGE_NAMES = [\n 'transparent-blend',\n 'bloom',\n 'output-transform',\n 'fxaa',\n 'post-effect',\n 'present',\n] as const;\nexport type StandardPostStage = (typeof STANDARD_POST_STAGE_NAMES)[number];\nexport type StandardVolumetricFogQuality = 'low' | 'high';\n\nexport interface StandardVolumetricFogProfile {\n readonly quality: StandardVolumetricFogQuality;\n readonly depth: 48 | 64;\n readonly tileSize: 4 | 16;\n}\n\nexport interface StandardProfile {\n readonly pipelineId: typeof STANDARD_PIPELINE_ID;\n readonly lightCount: StandardLightCount;\n readonly lighting: StandardLightingLane;\n readonly shadows: StandardShadowMode;\n readonly pbr: boolean;\n readonly ibl: boolean;\n readonly ssao: boolean;\n readonly bloom: boolean;\n readonly tone: StandardTone;\n readonly antialias: StandardAntialias;\n readonly sky: boolean;\n /** Renderer-owned 1080p volume profile; tile width/height remain surface-derived. */\n readonly volumetricFog?: StandardVolumetricFogProfile | undefined;\n readonly fallback: StandardFallbackLane;\n readonly postStages: typeof STANDARD_POST_STAGE_NAMES;\n}\n\nexport const DEFAULT_STANDARD_PROFILE: StandardProfile = Object.freeze({\n pipelineId: STANDARD_PIPELINE_ID,\n lightCount: 32,\n lighting: 'direct',\n shadows: 'filtered',\n pbr: true,\n ibl: true,\n ssao: false,\n bloom: true,\n tone: 'aces-filmic',\n antialias: 'fxaa',\n sky: true,\n fallback: 'native',\n postStages: STANDARD_POST_STAGE_NAMES,\n});\n\nexport function resolveVolumetricFogProfile(\n profile: Pick<StandardProfile, 'volumetricFog'>,\n): StandardVolumetricFogProfile {\n return profile.volumetricFog ?? { quality: 'high', depth: 64, tileSize: 4 };\n}\n\nexport type StandardLane = StandardLightingLane | 'cpu-webgl2';\n\nexport function resolveStandardLane(\n profile: Pick<StandardProfile, 'lighting'>,\n capabilities: { readonly compute: boolean; readonly storageBuffer: boolean },\n): StandardLane {\n if (!capabilities.compute || !capabilities.storageBuffer) return 'cpu-webgl2';\n return profile.lighting;\n}\n","import type { AssetRuntimeError } from '@forgeax/engine-assets-runtime';\nimport type { World } from '@forgeax/engine-ecs';\nimport type { RenderReadLease } from '@forgeax/engine-ecs/projection';\nimport type { Vec3 } from '@forgeax/engine-math';\nimport type { ProfileFrameToken, Profiler } from '@forgeax/engine-profiler';\nimport type { ColorValueDomain, RenderGraphError } from '@forgeax/engine-render-graph';\nimport type {\n BindGroupLayout,\n Buffer,\n Result,\n RhiCanvasSurfacePresentationProof,\n RhiCaps,\n RhiCommandEncoder,\n RhiDevice,\n RhiError,\n RhiInstance,\n RhiRenderPassEncoder,\n RenderPipeline as RhiRenderPipeline,\n Sampler,\n Texture,\n TextureFormat,\n TextureView,\n} from '@forgeax/engine-rhi';\nimport type { SkinError } from '@forgeax/engine-skinning';\nimport type { ImageError } from '@forgeax/engine-types';\nimport type { RhiBackendInstrumentation } from './assembly/backend-contract';\nimport type { Antialias, BloomEnabled, Tonemap } from './components/camera';\nimport type { EnvironmentInspection } from './environment/inspection';\nimport type { RenderError } from './errors/render';\nimport type { RenderFeature, RenderFeatureDiagnostics } from './features/types';\nimport type { PostProcessShaderEntry } from './fullscreen-post-process-pass';\nimport type {\n BloomInspection,\n MotionBlurInspection,\n RenderSceneInspection,\n TemporalTargetInspection,\n TransmissionInspection,\n} from './inspection-types';\nimport type { TemporalInspection } from './temporal/inspection';\n\nexport type { TransmissionInspection } from './inspection-types';\nexport type { PointsLinesInspection } from './points-lines/inspection';\n\nimport type { MeshMaterialBindingObservation } from './mesh-material-bindings';\nimport type { StandardProfile } from './pipeline/standard-profile';\nimport type { PostProcessError } from './post-process-errors';\nimport type { VolumeTimingObservation } from './record/gpu-timing';\nimport type { TemporalView } from './temporal/view';\nimport type { VolumetricFogInspection } from './volume/inspection';\n\nexport type RenderResult<T, E> =\n | { readonly ok: true; readonly value: T }\n | { readonly ok: false; readonly error: E };\n\n/** The only World data boundary accepted by the M6 renderer contract. */\nexport type RenderWorldLease = RenderReadLease;\n\n/**\n * Camera facts shared by extract, record, and scene owners.\n *\n * The extract stage resolves ECS camera state once and publishes this closed\n * POD contract. Keeping it beside the render lifecycle contracts prevents\n * extract from depending on the record implementation owner.\n */\nexport interface CameraSnapshot {\n /** Stable ECS identity used by the frame plan's camera authority fact. */\n readonly entityKey?: number;\n /** World index supplied by the multi-world extract merge. */\n readonly worldId?: number;\n /** Camera-owned history generation forwarded into the frame plan. */\n readonly historyVersion?: number;\n /** World-space camera translation (mat4.getTranslation of Transform.world). */\n readonly position: Vec3;\n /** Resolved world-space camera mat4, copied from Transform.world. */\n readonly world: Float32Array;\n readonly fov: number;\n readonly aspect: number;\n readonly near: number;\n readonly far: number;\n /** Camera projection variant used by view and shadow matrix builders. */\n readonly projection: 'perspective' | 'orthographic';\n readonly orthoLeft: number;\n readonly orthoRight: number;\n readonly orthoBottom: number;\n readonly orthoTop: number;\n readonly tonemap: Tonemap;\n readonly exposure: number;\n readonly whitePoint: number;\n readonly antialias: Antialias;\n readonly bloom: BloomEnabled;\n readonly bloomThreshold: number;\n readonly bloomIntensity: number;\n readonly bloomBlurRadius: number;\n readonly clearColor: readonly [number, number, number, number];\n /** Renderer-owned temporal projection used by Standard's TAA producer. */\n readonly temporal?: TemporalView;\n /** Active-camera motion blur parameters, present only when demanded. */\n readonly motionBlur?: {\n readonly shutterAngle: number;\n readonly maxRadiusPixels: number;\n readonly sampleCount: number;\n };\n}\n\n/** Stable identity owned by the Standard feature host for output transform. */\nexport const STANDARD_OUTPUT_TRANSFORM_FEATURE_ID = 'forgeax::standard::output-transform';\n\nexport type {\n EnvironmentFrame,\n EnvironmentSource,\n FogFrame,\n FramePlan,\n} from './extract/environment';\nexport type { TemporalView } from './temporal/view';\n\n/**\n * Render-graph state exposed to pipeline declarations. Concrete pipeline\n * caches stay in the assembly owner; graph code only needs the two target\n * formats that affect fullscreen descriptors.\n */\ninterface RenderPipelineStateView {\n readonly format: TextureFormat;\n readonly colorAttachmentFormat: TextureFormat;\n /** Renderer-owned View UBO shared by Standard lighting, shadows, and fog. */\n readonly viewUniformBuffer: Buffer;\n /** Renderer-owned SpotLight std430 buffer shared by Standard and volume. */\n readonly pointLightsBuffer: Buffer;\n readonly spotLightsBuffer: Buffer;\n /** Fallback resources keep the shared view layout valid when no projector is authored. */\n readonly defaultWhiteTextureView: TextureView;\n readonly defaultSampler: Sampler;\n}\n\n/**\n * Narrow runtime capability consumed by typed graph primitives. The concrete\n * RenderSystemRuntime structurally satisfies this contract, but the public\n * frame surface does not depend on that assembly owner.\n */\ninterface RenderPipelineRuntime {\n readonly device: RhiDevice;\n /** Runtime-owned shader module factory used by built-in graph producers. */\n readonly shaderModuleFactory?: {\n createShaderModule(input: {\n readonly code: string;\n readonly label?: string | undefined;\n }): import('@forgeax/engine-types').Result<\n import('@forgeax/engine-rhi').ShaderModule,\n RhiError\n >;\n };\n readonly errorRegistry: { fire(error: RendererError): void };\n readonly debugOverlay?: RenderDebugOverlay | undefined;\n readonly lookupPostProcess?: (id: string) => PostProcessShaderEntry | undefined;\n readonly getPostProcessParamsBuffer?: (id: string) => Buffer | undefined;\n readonly getPostProcessPipeline?: (\n id: string,\n bgl: BindGroupLayout,\n colorFormat: GPUTextureFormat,\n ) => RhiRenderPipeline | null;\n}\n\n/**\n * Render-owned declaration for an app-provided debug overlay. App owns the\n * concrete DebugDraw instance and its GPU lifecycle; Render only records this\n * capability in the typed graph.\n */\nexport interface RenderDebugOverlay {\n encode(\n pass: RhiRenderPassEncoder,\n viewProj: import('@forgeax/engine-math').Mat4,\n ): Result<void, unknown>;\n}\n\n/**\n * The leaf frame context consumed by RenderPipeline and graph primitives.\n * Concrete assembly data is added only by the internal record extension in\n * render-system.ts, so this contract never imports the RenderSystem owner.\n */\nexport interface RenderPipelineContext {\n readonly pipelineState: RenderPipelineStateView;\n readonly runtime: RenderPipelineRuntime;\n readonly encoder: RhiCommandEncoder;\n readonly view: TextureView;\n readonly clear: readonly [number, number, number, number] | number[];\n readonly targetW: number;\n readonly targetH: number;\n readonly currentTexture: Texture;\n readonly camera: CameraSnapshot;\n /** Per-frame post-process parameter bytes keyed by shader id. */\n readonly postProcessParams: ReadonlyMap<string, Uint8Array>;\n readonly msaaActive: boolean;\n readonly geometryColorResolveView: TextureView | null;\n readonly ldrSpriteColorView: TextureView | null;\n /** Renderer-owned volume resources prepared from the authored ECS snapshot. */\n readonly volumetricFog?: VolumetricFogFrameContext;\n /** Renderer-owned SpotLight projector resources, independent of fog. */\n readonly spotLightProjector?: SpotLightProjectorFrameContext;\n /** Build-time composed utility sources for the renderer-owned volume passes. */\n readonly volumetricFogShaders?: VolumetricFogShaderSources;\n}\n\n/** Stable utility entry-point sources emitted by the shader manifest. */\nexport interface VolumetricFogShaderSources {\n readonly inject: string;\n readonly temporal: string;\n readonly integrate: string;\n readonly composite: string;\n}\n\n/**\n * GPU resources for one validated volumetric-fog candidate. The record stage\n * owns residency and parameter uploads; graph passes consume this narrow view\n * and never reach into AssetRegistry or World.\n */\nexport interface VolumetricFogFrameContext {\n readonly densityTexture: Texture;\n readonly densityView: TextureView;\n readonly paramsBuffer: Buffer;\n readonly densityGeneration: number;\n /** Accepted graph-owned history slot; null means first frame/reset. */\n readonly historyReadSlot: 0 | 1 | null;\n /** Pending graph-owned history slot; promoted only after queue.submit succeeds. */\n readonly historyWriteSlot: 0 | 1;\n readonly historyValid: boolean;\n /** Accepted SpotLight projector resources resolved by the GPU residency owner. */\n readonly projectorTexture?: Texture;\n readonly projectorView?: TextureView;\n readonly projectorSampler?: Sampler;\n}\n\n/**\n * GPU resources for the single surface SpotLight projector binding. The\n * projector is a SpotLight-owned cookie and therefore remains available when\n * volumetric fog is disabled; volume integration may reuse the same tuple.\n */\nexport interface SpotLightProjectorFrameContext {\n readonly texture: Texture;\n readonly view: TextureView;\n readonly sampler: Sampler;\n}\n\n/**\n * The sole public renderer contract. Concrete assembly stays behind the host;\n * callers retain only leases, receipts, inspection PODs, and recovery Result.\n */\nexport interface Renderer {\n attach(world: World): RenderResult<RenderWorldLease, RenderError>;\n draw(input: RenderFrameInput): RenderResult<FrameReceipt, RenderError>;\n setProfile(profile: RenderProfile): RenderResult<void, RenderError>;\n state(): RendererState;\n inspect(): RenderInspection;\n observe(\n receipt: FrameReceipt,\n request: FrameObservationRequest,\n ): Promise<RenderResult<FrameReceiptObservation, RenderError>>;\n subscribe(listener: (event: RendererEvent) => void): () => void;\n releaseSurface(): RenderResult<void, RenderError>;\n restoreSurface(): RenderResult<void, RenderError>;\n recover(): Promise<RenderResult<void, RenderError>>;\n dispose(): Promise<RenderResult<void, RenderError>>;\n}\n\n/** The single public renderer lifecycle authority. */\nexport type RendererState = 'alive' | 'device-lost' | 'recovering' | 'faulted' | 'disposed';\n\n/** Immutable, inspectable quality and budget policy for the Standard pipeline. */\nexport type RenderProfile = StandardProfile;\n\n/** Ordered events projected from renderer state and expected-operation failures. */\nexport type RendererEvent =\n | {\n readonly kind: 'state-changed';\n readonly previous: RendererState;\n readonly current: RendererState;\n }\n | { readonly kind: 'error'; readonly error: RenderError }\n /** Emitted only after the renderer's sole submit path returns a receipt. */\n | {\n readonly kind: 'frame-submitted';\n readonly frameId: number;\n readonly deviceGeneration: number;\n };\n\n/** Package-local listener alias used by the renderer assembly implementation. */\nexport type RendererEventListener = (event: RendererEvent) => void;\n\n/**\n * Camera authority supplied for one frame; Render owns the lease contract and\n * the host releases it with the frame lifecycle. It is intentionally bound to\n * the attached scene lease and never accepts a backend object.\n */\nexport interface FrameCamera {\n readonly lease: RenderWorldLease;\n readonly entityKey?: number;\n}\n\n/**\n * Environment authority supplied for one frame. The scene/environment owner\n * supplies the identity; the host validates it against the attached lease.\n */\nexport interface FrameEnvironment {\n readonly lease: RenderWorldLease;\n readonly identity?: string;\n}\n\n/**\n * Receipt-bound observation selection. The request is consumed by `observe`\n * only with the matching FrameReceipt and returns a structured Result error\n * when the generation or frame identity is stale.\n */\nexport interface FrameObservationRequest {\n readonly include: readonly ('timings' | 'draws' | 'bindings')[];\n}\n\n/**\n * Immutable synchronous proof that the sole host-owned submit reached the\n * queue. It is the only successful synchronous draw signal and is required by\n * every observation request.\n */\nexport interface FrameReceipt {\n readonly frameId: number;\n readonly deviceGeneration: number;\n readonly completed: Promise<RenderResult<void, RenderError>>;\n}\n\n/**\n * The sole public draw input; World objects never cross this boundary. Render\n * owns extraction and graph interpretation, while the host owns encoding,\n * finish, submit, and recovery of the attached lease generation.\n */\nexport interface RenderFrameInput {\n readonly leases: readonly RenderWorldLease[];\n readonly camera: FrameCamera;\n readonly environment: FrameEnvironment;\n /** Optional profiler correlation token owned by App and consumed by Render. */\n readonly profileFrame?: ProfileFrameToken;\n}\n\n/** Detached, bounded observation metadata tied to one FrameReceipt and request. */\nexport interface FrameReceiptObservation {\n readonly frameId: number;\n readonly deviceGeneration: number;\n readonly include: readonly ('timings' | 'draws' | 'bindings')[];\n readonly timings?: VolumeTimingObservation;\n}\n\n/** Stable backend facts for the Standard output transform projection. */\nexport interface RenderOutputInspection {\n readonly outputTransform?: typeof STANDARD_OUTPUT_TRANSFORM_FEATURE_ID;\n readonly displayEncoded: boolean;\n readonly intermediateFormat?: TextureFormat;\n /** Concrete surface route committed by configureSurface. */\n readonly surfaceProfile?: 'dual-view' | 'raw-only';\n /** Pass names from the same committed graph as the output facts. */\n readonly graphPassNames: readonly string[];\n /** Detached descriptor for the graph-owned output target, when present. */\n readonly standardOutputColor?: RenderStandardOutputColorInspection;\n readonly surfaceStorage: TextureFormat;\n readonly surfaceDisplay: TextureFormat;\n readonly endpoint: 'surface.storage.raw';\n readonly capability: 'rgba16float-renderable' | 'surface-raw-endpoint' | 'unavailable';\n readonly presentationProof?: RhiCanvasSurfacePresentationProof;\n readonly error:\n | {\n readonly code: string;\n readonly expected: string;\n readonly hint: string;\n readonly detail?: unknown;\n }\n | undefined;\n}\n\n/** Detached descriptor for the graph-owned display-encoded intermediate. */\nexport interface RenderStandardOutputColorInspection {\n readonly format: TextureFormat;\n readonly domain?: ColorValueDomain;\n readonly width: number;\n readonly height: number;\n readonly sampleCount: number;\n readonly usage: number;\n}\n\n/** Stable identity refs for a renderer-owned frame observation. */\nexport interface RenderObservationInspection {\n readonly observationId: string;\n readonly frameId: number;\n /** Camera antialias mode used by the frame carrying this observation. */\n readonly antialias?: Antialias;\n /** Surface route committed for the same frame graph. */\n readonly surfaceProfile?: 'dual-view' | 'raw-only';\n /** Capability fact used when resolving a raw-only float target. */\n readonly rgba16floatRenderable?: boolean;\n /** Exact pass names and target descriptor from the committed graph. */\n readonly passNames: readonly string[];\n readonly standardOutputColor?: RenderStandardOutputColorInspection;\n}\n\n/**\n * Detached renderer facts for host diagnostics and capability selection.\n *\n * The snapshot contains only POD values. It never exposes a device, queue,\n * registry, encoder, or live renderer-owned collection.\n */\nexport interface RenderInspection {\n readonly state: RendererState;\n readonly surface: 'available' | 'released';\n readonly profile: RenderProfile;\n readonly capabilities: Readonly<RhiCaps>;\n readonly frame: {\n readonly frameId: number;\n readonly deviceGeneration: number;\n };\n /** Renderer-owned authored volume projection and submit/LKG state. */\n readonly volumetricFog?: VolumetricFogInspection;\n readonly features: readonly string[];\n /** Truthful lifecycle facts for every registered declarative feature. */\n readonly featureDiagnostics: readonly RenderFeatureDiagnostics[];\n readonly frustumStats: { readonly culled: number; readonly total: number };\n readonly visibilityStats: { readonly explicitlyHidden: number };\n readonly renderScene: RenderSceneInspection;\n /** Last completed transmission candidate facts, detached from GPU handles. */\n readonly transmission?: TransmissionInspection;\n readonly meshMaterialBindings: readonly MeshMaterialBindingObservation[];\n readonly perFramePassNames: readonly string[];\n readonly bindGroupCounts: {\n readonly createBindGroup: number;\n readonly keys: readonly string[];\n };\n /** Output transform facts; never includes fixture metrics or pixel bytes. */\n readonly outputTransform?: typeof STANDARD_OUTPUT_TRANSFORM_FEATURE_ID;\n readonly displayEncoded: boolean;\n readonly intermediateFormat?: TextureFormat;\n readonly surfaceStorage: TextureFormat;\n readonly surfaceDisplay: TextureFormat;\n readonly endpoint: 'surface.storage.raw';\n readonly capability: RenderOutputInspection['capability'];\n readonly presentationProof?: RhiCanvasSurfacePresentationProof;\n readonly error: RenderOutputInspection['error'];\n readonly observation: RenderObservationInspection;\n readonly environment: EnvironmentInspection;\n readonly temporal: TemporalInspection;\n readonly bloom: BloomInspection;\n /** Semantic Standard temporal target metadata; no graph or RHI handles. */\n readonly temporalTarget?: TemporalTargetInspection;\n /** Renderer-owned Motion Blur facts; absent when no component is active. */\n readonly motionBlur?: MotionBlurInspection;\n}\n\n/** Backend marker — single-element union preserved for future extensibility (D-2). */\n/**\n * `renderer.draw(worlds, options)` owner options\n * (feat-20260709-editor-world-partition M1 / w6, plan-strategy §2 D-3).\n *\n * The single `owner` index that previously served BOTH the surfaced cameras\n * and the singleton render resources (skylight / skybox / postProcessParams) is\n * split into two independent indices:\n * - `cameraOwner` — the world whose cameras are surfaced.\n * - `resourceOwner` — the world whose skylight / skybox / postProcessParams\n * are surfaced.\n *\n * Both owners are always explicit. Single-world callers pass zero for both;\n * composite callers may select different worlds.\n */\nexport type DrawOwnerOptions = {\n readonly cameraOwner: number;\n readonly resourceOwner: number;\n readonly profileFrame?: ProfileFrameToken;\n};\n\n/** Information attached to a device-loss notification. */\nexport interface RendererLostInfo {\n /** Concise machine-readable cause, mapped to a single vocabulary. */\n reason: string;\n /** Free-form description (UA / extension / driver text). */\n message: string;\n}\n\n/** Listener registered through `Renderer.onLost`. */\nexport type RendererLostListener = (info: RendererLostInfo) => void;\n\n/**\n * Composite error type retained for package-local renderer diagnostics. The\n * public Renderer projects expected operation failures through the single\n * `subscribe` event stream and its `error` event; this type does NOT define a\n * error; it only references the cluster unions whose members can arrive here.\n * As such it is an external wire alias (AGENTS.md Change stance add-only wire\n * exception), NOT the eliminated cross-cluster `RuntimeError` SSOT (D-3).\n *\n * Composition = `RhiError | RenderError | AssetRuntimeError | SkinError |\n * PostProcessError`. This equals the pre-decomposition\n * `RhiError | RuntimeError | PostProcessError` exactly: `RuntimeError` was\n * `RenderError | AssetRuntimeError | SkinError` (27 classes). `RecoverError`\n * and `EngineEnvironmentError` are intentionally excluded — neither is ever\n * emitted through the Renderer event stream (`RecoverError` returns from `recover()`,\n * `EngineEnvironmentError` throws at construction), matching the original\n * `RuntimeError` union which excluded both (OOS-3 behavior equivalence).\n *\n * AI consumers do `switch (err.code)` over the union: the disjoint\n * `RhiErrorCode` / `RenderErrorCode` / `AssetRuntimeErrorCode` / `SkinErrorCode`\n * / `PostProcessErrorCode` literal sets let TS narrow each arm to the concrete\n * class (charter P3 union discoverability — every fan-out member is reachable\n * in an exhaustive switch, no untyped escape). Example:\n *\n * ```ts\n * renderer.subscribe((event) => {\n * if (event.kind !== 'error') return;\n * switch (event.error.code) {\n * case 'asset-not-registered': // AssetRuntimeError arm, err narrowed here\n * return report(err.hint);\n * // ...one arm per RhiErrorCode | RenderErrorCode | AssetRuntimeErrorCode\n * // | SkinErrorCode | PostProcessErrorCode member; no default needed,\n * // TS flags every unhandled code at compile time.\n * }\n * });\n * ```\n */\nexport type RendererError =\n | RhiError\n | RenderGraphError\n | ImageError\n | RenderError\n | AssetRuntimeError\n | SkinError\n | PostProcessError;\n\n/**\n * Package-local error listener retained for host assembly. Public consumers\n * use `Renderer.subscribe` and receive `RendererEvent` instead.\n */\nexport type RendererErrorListener = (error: RendererError) => void;\n\n/**\n * Built-in graph pass owners used as nested children of `record/graph-execute`.\n * Unknown extension pass names use the explicit `other` bucket so custom\n * pipelines retain a bounded catalog while the default render workload gets\n * actionable owner attribution.\n */\nexport const RENDER_GRAPH_EXECUTION_PHASE_CATALOG = [\n 'record/graph-execute/point-shadow',\n 'record/graph-execute/cluster-binner-upload',\n 'record/graph-execute/g-buffer',\n 'record/graph-execute/g-buffer/geometry-loop',\n 'record/graph-execute/g-buffer/material-bind-groups',\n 'record/graph-execute/g-buffer/pipeline-selection',\n 'record/graph-execute/g-buffer/draw-submit',\n 'record/graph-execute/ssao-calc',\n 'record/graph-execute/ssao-blur',\n 'record/graph-execute/lighting',\n 'record/graph-execute/forward',\n 'record/graph-execute/forward/geometry-loop',\n 'record/graph-execute/forward/material-bind-groups',\n 'record/graph-execute/forward/pipeline-selection',\n 'record/graph-execute/forward/draw-submit',\n 'record/graph-execute/output-transform',\n 'record/graph-execute/present',\n 'record/graph-execute/debug-overlay',\n 'record/graph-execute/shadow',\n 'record/graph-execute/spot-shadow',\n 'record/graph-execute/skybox',\n 'record/graph-execute/main',\n 'record/graph-execute/fxaa',\n 'record/graph-execute/bloom-bright',\n 'record/graph-execute/bloom-blur-h',\n 'record/graph-execute/bloom-blur-v',\n 'record/graph-execute/bloom-composite',\n 'record/graph-execute/other',\n] as const;\n\nexport type RenderGraphExecutionPhase = (typeof RENDER_GRAPH_EXECUTION_PHASE_CATALOG)[number];\n\n/** Bounded producer-owned children of the scene-state record owner. */\nexport const RENDER_HDRP_BINNER_PHASE_CATALOG = [\n 'record/scene-state/hdrp-cluster/binner/light-bounds-and-occupancy',\n 'record/scene-state/hdrp-cluster/binner/light-bounds-and-occupancy/light-aabb',\n 'record/scene-state/hdrp-cluster/binner/light-bounds-and-occupancy/cluster-occupancy',\n 'record/scene-state/hdrp-cluster/binner/cluster-reserve',\n 'record/scene-state/hdrp-cluster/binner/input-preparation',\n 'record/scene-state/hdrp-cluster/binner/bin-core',\n 'record/scene-state/hdrp-cluster/binner/light-index-write',\n 'record/scene-state/hdrp-cluster/binner/light-index-write/bounds-read',\n 'record/scene-state/hdrp-cluster/binner/light-index-write/cluster-write',\n] as const;\n\nexport const RENDER_HDRP_CLUSTER_PHASE_CATALOG = [\n 'record/scene-state/hdrp-cluster/binner',\n ...RENDER_HDRP_BINNER_PHASE_CATALOG,\n 'record/scene-state/hdrp-cluster/payload-packing',\n 'record/scene-state/hdrp-cluster/buffer-upload',\n] as const;\n\nexport type RenderHdrpClusterPhase = (typeof RENDER_HDRP_CLUSTER_PHASE_CATALOG)[number];\n\nexport const RENDER_SCENE_STATE_PHASE_CATALOG = [\n 'record/scene-state/fold-buckets',\n 'record/scene-state/lighting-prep',\n 'record/scene-state/ambient-resolution',\n 'record/scene-state/directional-shadow-cache',\n 'record/scene-state/hdrp-cluster',\n ...RENDER_HDRP_CLUSTER_PHASE_CATALOG,\n] as const;\n\n/**\n * Opt-in boundaries inside one `Renderer.draw` call. The observer is a\n * diagnostics seam only: it receives wall-time boundaries and must never be\n * required for rendering correctness. The stage names mirror the existing\n * engine-owned Extract / Prepare / Record orchestration so a host can measure\n * attribution without guessing from RHI command counts.\n */\nexport const RENDER_RECORD_PHASE_CATALOG = [\n 'record/scene-state',\n ...RENDER_SCENE_STATE_PHASE_CATALOG,\n 'record/swapchain',\n 'record/render-graph',\n 'record/target-views',\n 'record/validation',\n 'record/dispatch-plan',\n 'record/uploads',\n 'record/bind-groups',\n 'record/graph-execute',\n ...RENDER_GRAPH_EXECUTION_PHASE_CATALOG,\n] as const;\n\nexport type RenderRecordPhase = (typeof RENDER_RECORD_PHASE_CATALOG)[number];\n\nexport const RENDER_PHASE_CATALOG = [\n 'extract',\n 'bind-groups',\n 'features',\n 'sort',\n 'record',\n ...RENDER_RECORD_PHASE_CATALOG,\n] as const;\n\nexport type RenderPhase = (typeof RENDER_PHASE_CATALOG)[number];\n\nexport type RenderPhaseSkipReason =\n | 'feature-host-unavailable'\n | 'feature-host-empty'\n | 'pipeline-state-unavailable'\n | 'camera-unavailable';\n\n/** First-version options bag (intentionally empty; reserved for v0.1). */\nexport interface RendererOptions {\n /** Producer-owned features installed by the renderer host. */\n readonly features?: readonly RenderFeature<unknown>[] | undefined;\n /** Standard profile consumed by the single renderer-owned pipeline. */\n readonly standardProfile?: RenderProfile | undefined;\n /** Explicit profiler capability shared by App and Render. */\n readonly profiler?: Profiler | undefined;\n /** Explicitly request timestamp-query for receipt-bound GPU profiling. */\n readonly captureGpuTimings?: boolean | undefined;\n /** Optional host-owned RHI lifecycle instrumentation, such as recording. */\n readonly rhiInstrumentation?: RhiBackendInstrumentation | undefined;\n // feat-20260608-create-app-param-surface-trim / M1 / AC-02: `clearColor`\n // was deleted as a one-cut breaking change (AGENTS.md Change stance +\n // requirements constraint #1: no deprecation window, no shim). Scene\n // clear color now lives on the Camera entity (`clearColor`, an inline\n // array<f32,4> column as of feat-20260709 M3); zero-Camera fallback uses\n // `ZERO_CAMERA_CLEAR_FALLBACK = [0, 0, 0, 1]` from\n // `render-system-record`. AI users that pass `{ clearColor: [...] }` on\n // RendererOptions still get a TS2353 excess-property error at compile time.\n //\n // feat-20260608-create-app-param-surface-trim / M2 / AC-06 + D-3:\n // `shaderManifestUrl` was deleted from RendererOptions and moved to\n // the third-arg `BundlerOptions` (build-tool injection channel). The\n // fallback literal '/shaders/manifest.json' stays at the createRenderer\n // body site (D-2 q5-A) so the LO 1.1 zero-config takeoff path keeps\n // working without explicit injection. AI users that pass\n // `{ shaderManifestUrl: '...' }` to RendererOptions get a TS2353\n // excess-property error at compile time pointing them to the third\n // arg (charter P1 progressive disclosure -- the message names\n // BundlerOptions, not a free-form string).\n /**\n * M3 D-P4 escape hatch (feat-20260511-rhi-wgpu-impl): explicit\n * `RhiInstance` injection bypasses the dynamic-import auto-select\n * facade. When set, `createRenderer` uses this instance verbatim and\n * neither concrete backend adapter is imported dynamically (charter\n * proposition 5 discoverable opt-in /\n * plan-strategy §6 M3 + §7.4 escape hatch + Bevy\n * `RenderCreation::Manual` partial equivalent).\n *\n * Typical use cases:\n * - Testing / debugging — inject a deterministic stub.\n * - Pinning a specific backend even when the browser adapter is present,\n * for cross-shim regression tests.\n * - Advanced AI users implementing their own `RhiInstance` shim.\n *\n * AI users who want the default behaviour leave this field omitted;\n * `navigator.gpu` presence/absence drives the dynamic import (see the\n * `createRenderer` JSDoc for the full auto-select decision tree).\n */\n readonly rhi?: RhiInstance | undefined;\n}\n\n// ────────────────────────────────────────────────────────────────────────────\n// Renderer health / recover surface (feat-20260621-renderer-health-recover-skeleton M1)\n// ────────────────────────────────────────────────────────────────────────────\n\n/**\n * Closed union of renderer health states.\n *\n * 3 members per plan-strategy D-1:\n * - `'alive'` — healthy baseline (registry not yet fired)\n * - `'device-lost'` — device loss detected\n * - `'internal-fault'` — internal renderer fault\n *\n * AI users exhaustively switch on `HealthReason` without default; TS guards\n * completeness.\n */\nexport type HealthReason = 'alive' | 'device-lost' | 'internal-fault';\n\n/** Detail for `HealthReason 'device-lost'`. */\nexport interface HealthDetailDeviceLost {\n readonly lostReason: 'unknown' | 'destroyed';\n readonly message: string;\n}\n\n/** Detail for `HealthReason 'internal-fault'`. */\nexport interface HealthDetailInternalFault {\n readonly message: string;\n}\n\n/**\n * Pull-style health snapshot — discriminated union by `reason`.\n *\n * Per plan-strategy D-2: `switch(snap.reason)` narrows `snap.detail` to the\n * per-reason detail type automatically, with zero `as` casts. `alive` has no\n * `.detail` field; `device-lost` / `internal-fault` have a required `.detail`\n * of the respective variant.\n *\n * - `recoverable` — explicit snapshot data owned by the lifecycle authority\n */\nexport type HealthSnapshot =\n | { readonly reason: 'alive'; readonly recoverable: boolean }\n | {\n readonly reason: 'device-lost';\n readonly detail: HealthDetailDeviceLost;\n readonly recoverable: boolean;\n }\n | {\n readonly reason: 'internal-fault';\n readonly detail: HealthDetailInternalFault;\n readonly recoverable: boolean;\n };\n\n/**\n * Maps `HealthReason` to recoverable boolean per the derive table\n * (requirements section \"range\"):\n *\n * | reason | recoverable |\n * |:---------------|:-----------|\n * | `'alive'` | false |\n * | `'device-lost'`| true |\n * | `'internal-fault'` | false |\n */\n/** Callback type for `Renderer.onHealthChange`. */\nexport type HealthChangeListener = (snapshot: HealthSnapshot) => void;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/materials.ts"],"names":[],"mappings":";;;AAkBO,IAAM,iCAAA,GAAN,cAAgD,KAAA,CAAM;AAAA,EAClD,IAAA,GAAO,wCAAA;AAAA,EACP,QAAA,GAAW,4EAAA;AAAA,EACX,IAAA,GACP,kFAAA;AAAA,EACO,MAAA;AAAA,EAaT,WAAA,CACE,SAAA,EACA,MAAA,EACA,MAAA,EACA;AACA,IAAA,KAAA,CAAM,CAAA,oBAAA,EAAuB,SAAS,CAAA,qCAAA,EAAwC,MAAM,CAAA,CAAA,CAAG,CAAA;AACvF,IAAA,IAAA,CAAK,IAAA,GAAO,mCAAA;AACZ,IAAA,IAAA,CAAK,MAAA,GAAS;AAAA,MACZ,IAAA,EAAM,wCAAA;AAAA,MACN,QAAA,EAAU,UAAA;AAAA,MACV,SAAA;AAAA,MACA,MAAA;AAAA,MACA,GAAI,MAAA,KAAW,MAAA,GAAY,EAAC,GAAI,EAAE,MAAA;AAAO,KAC3C;AAAA,EACF;AACF;AAEO,IAAM,gCAAA,GAAkD;AAAA,EAC7D,OAAO,EAAE,SAAA,EAAW,OAAO,SAAA,EAAW,qBAAA,EAAuB,WAAW,KAAA,EAAM;AAAA,EAC9E,OAAO,EAAE,SAAA,EAAW,OAAO,SAAA,EAAW,qBAAA,EAAuB,WAAW,KAAA;AAC1E;AAEA,IAAM,eAAA,GAAkB,4BAAA;AACxB,IAAM,YAAA,GAAe,yBAAA;AAGrB,SAAS,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FPLTKCU.mjs","sourcesContent":["import { DEFAULT_STANDARD_PBR_PARAM_SCHEMA } from '@forgeax/engine-shader';\nimport type {\n MaterialAsset,\n MaterialColorSpace,\n MaterialParameter,\n MaterialPass,\n MaterialRenderState,\n MaterialValue,\n} from '@forgeax/engine-types';\n\nexport type MaterialTransmissionValidationReason =\n | 'non-finite'\n | 'range'\n | 'shape'\n | 'blend'\n | 'depth-write';\n\n/** Structured authoring failure for the Standard transmission contract. */\nexport class MaterialTransmissionContractError extends Error {\n readonly code = 'material-transmission-contract-invalid' as const;\n readonly expected = 'transmission material values satisfy finite ranges and Forward depth rules';\n readonly hint =\n 'repair the named transmission value or pass state before publishing the material';\n readonly detail: {\n readonly code: 'material-transmission-contract-invalid';\n readonly material: 'Standard';\n readonly parameter:\n | 'transmission'\n | 'ior'\n | 'thickness'\n | 'attenuationColor'\n | 'attenuationDistance';\n readonly reason: MaterialTransmissionValidationReason;\n readonly actual?: unknown;\n };\n\n constructor(\n parameter: (typeof MaterialTransmissionContractError.prototype.detail)['parameter'],\n reason: MaterialTransmissionValidationReason,\n actual?: unknown,\n ) {\n super(`Materials.standard: ${parameter} violates the transmission contract (${reason})`);\n this.name = 'MaterialTransmissionContractError';\n this.detail = {\n code: 'material-transmission-contract-invalid',\n material: 'Standard',\n parameter,\n reason,\n ...(actual === undefined ? {} : { actual }),\n };\n }\n}\n\nexport const SPRITE_PREMULTIPLIED_ALPHA_BLEND: GPUBlendState = {\n color: { srcFactor: 'one', dstFactor: 'one-minus-src-alpha', operation: 'add' },\n alpha: { srcFactor: 'one', dstFactor: 'one-minus-src-alpha', operation: 'add' },\n};\n\nconst STANDARD_MODULE = 'forgeax_material::standard';\nconst UNLIT_MODULE = 'forgeax_material::unlit';\nconst SPRITE_MODULE = 'forgeax_material::sprite';\n\nfunction authoredColorParameter(\n name: string,\n type: 'color' | 'vec3',\n colorSpace: MaterialColorSpace,\n optional = false,\n): MaterialParameter {\n return {\n name,\n type,\n ...(type === 'color' && colorSpace === 'srgb' ? {} : { colorSpace }),\n ...(optional ? { optional: true } : {}),\n };\n}\n\nfunction standardParameters(colorSpace: MaterialColorSpace): readonly MaterialParameter[] {\n return DEFAULT_STANDARD_PBR_PARAM_SCHEMA.map((entry) => {\n const type = entry.type.startsWith('texture') ? 'texture' : entry.type;\n const isRequired =\n entry.name === 'baseColor' || entry.name === 'metallic' || entry.name === 'roughness';\n const authoredColor =\n entry.type === 'color' || (entry.type === 'vec3' && entry.name !== 'attenuationColor');\n const schemaColorSpace = 'colorSpace' in entry ? entry.colorSpace : undefined;\n const colorSpaceProjection: { colorSpace?: MaterialColorSpace } = {};\n if (authoredColor && !(type === 'color' && colorSpace === 'srgb')) {\n colorSpaceProjection.colorSpace = colorSpace;\n } else if (!authoredColor && schemaColorSpace !== undefined) {\n colorSpaceProjection.colorSpace = schemaColorSpace;\n }\n return {\n name: entry.name,\n type,\n ...colorSpaceProjection,\n ...(isRequired ? {} : { optional: true }),\n } as MaterialParameter;\n });\n}\n\nfunction unlitParameters(colorSpace: MaterialColorSpace): readonly MaterialParameter[] {\n return [\n authoredColorParameter('baseColor', 'color', colorSpace),\n { name: 'alphaCutoff', type: 'f32', optional: true },\n { name: 'baseColorTexture', type: 'texture', optional: true },\n ];\n}\n\nfunction pass(\n name: string,\n module: string,\n renderState: MaterialRenderState | undefined,\n fragmentEntry?: string,\n queue?: number,\n): MaterialPass {\n const lightMode =\n name === 'shadow-caster' ? 'ShadowCaster' : name === 'deferred' ? 'Deferred' : 'Forward';\n const authoredState = (renderState ?? {}) as Readonly<Record<string, unknown>>;\n const authoredTags = authoredState.tags as Readonly<Record<string, string>> | undefined;\n return {\n name,\n program: {\n module,\n ...(fragmentEntry === undefined ? {} : { fragmentEntry }),\n },\n renderState: {\n ...authoredState,\n tags: { LightMode: lightMode, ...authoredTags },\n ...(queue === undefined ? {} : { queue }),\n },\n };\n}\n\ninterface UnlitOpts {\n /** Asset-side authored color space. Defaults to sRGB. */\n readonly colorSpace?: MaterialColorSpace;\n readonly castShadow?: boolean;\n readonly baseColorTexture?: MaterialValue;\n readonly alphaCutoff?: number;\n readonly renderState?: MaterialRenderState;\n readonly queue?: number;\n}\n\nfunction unlit(rgba: readonly [number, number, number, number], opts?: UnlitOpts): MaterialAsset {\n if (opts?.alphaCutoff !== undefined && (opts.alphaCutoff < 0 || opts.alphaCutoff > 1)) {\n throw new Error(`Materials.unlit: alphaCutoff must be in [0, 1], got ${opts.alphaCutoff}`);\n }\n const values: Record<string, MaterialValue> = { baseColor: rgba };\n if (opts?.baseColorTexture !== undefined) values.baseColorTexture = opts.baseColorTexture;\n if (opts?.alphaCutoff !== undefined) values.alphaCutoff = opts.alphaCutoff;\n const passes: [MaterialPass, ...MaterialPass[]] = [\n pass('forward', UNLIT_MODULE, opts?.renderState, undefined, opts?.queue),\n ];\n if (opts?.castShadow !== false) passes.push(pass('shadow-caster', UNLIT_MODULE, undefined));\n return {\n kind: 'material',\n ...(opts?.colorSpace === undefined || opts.colorSpace === 'srgb'\n ? {}\n : { colorSpace: opts.colorSpace }),\n passes,\n parameters: unlitParameters(opts?.colorSpace ?? 'srgb'),\n values,\n };\n}\n\ninterface StandardOpts {\n /** Asset-side authored color space for baseColor/emissive/specularTint. Defaults to sRGB. */\n readonly colorSpace?: MaterialColorSpace;\n readonly baseColor: readonly [number, number, number, number];\n readonly metallic?: number;\n readonly roughness?: number;\n /** Texture channel used for the metallic factor; glTF defaults to B (2). */\n readonly metallicChannel?: number;\n /** Texture channel used for the roughness factor; glTF defaults to G (1). */\n readonly roughnessChannel?: number;\n readonly clearcoat?: number;\n readonly clearcoatRoughness?: number;\n readonly specularTint?: readonly [number, number, number];\n readonly specularTintTexture?: MaterialValue;\n readonly emissive?: readonly [number, number, number];\n readonly emissiveIntensity?: number;\n readonly emissiveTexture?: MaterialValue;\n readonly baseColorTexture?: MaterialValue;\n readonly metallicRoughnessTexture?: MaterialValue;\n readonly normalTexture?: MaterialValue;\n readonly occlusionTexture?: MaterialValue;\n readonly occlusionStrength?: number;\n readonly alphaCutoff?: number;\n readonly transmission?: number;\n readonly transmissionTexture?: MaterialValue;\n readonly ior?: number;\n readonly thickness?: number;\n readonly thicknessTexture?: MaterialValue;\n readonly attenuationColor?: readonly [number, number, number];\n readonly attenuationDistance?: number;\n readonly renderState?: MaterialRenderState;\n readonly castShadow?: boolean;\n readonly queue?: number;\n}\n\nfunction validateChannel(\n name: 'metallicChannel' | 'roughnessChannel',\n value: number | undefined,\n): void {\n if (value !== undefined && (!Number.isInteger(value) || value < 0 || value > 3)) {\n throw new Error(`Materials.standard: ${name} must be an integer in [0, 3], got ${value}`);\n }\n}\n\nfunction validateFiniteRange(\n name: 'transmission' | 'ior' | 'thickness' | 'attenuationDistance',\n value: number | undefined,\n minimum: number,\n maximum?: number,\n): void {\n if (value === undefined || !Number.isFinite(value)) {\n if (value === undefined) return;\n throw new MaterialTransmissionContractError(name, 'non-finite', value);\n }\n if (value < minimum || (maximum !== undefined && value > maximum)) {\n throw new MaterialTransmissionContractError(name, 'range', value);\n }\n}\n\nfunction standard(opts: StandardOpts): MaterialAsset {\n const occlusionStrength = opts.occlusionStrength ?? 1;\n if (occlusionStrength < 0 || occlusionStrength > 1) {\n throw new Error(\n `Materials.standard: occlusionStrength must be in [0, 1], got ${occlusionStrength}`,\n );\n }\n if (opts.alphaCutoff !== undefined && (opts.alphaCutoff < 0 || opts.alphaCutoff > 1)) {\n throw new Error(`Materials.standard: alphaCutoff must be in [0, 1], got ${opts.alphaCutoff}`);\n }\n validateChannel('metallicChannel', opts.metallicChannel);\n validateChannel('roughnessChannel', opts.roughnessChannel);\n const transmission = opts.transmission ?? 0;\n const ior = opts.ior ?? 1.5;\n const thickness = opts.thickness ?? 0;\n const attenuationColor = opts.attenuationColor ?? [1, 1, 1];\n validateFiniteRange('transmission', transmission, 0, 1);\n validateFiniteRange('ior', ior, 1);\n validateFiniteRange('thickness', thickness, 0);\n validateFiniteRange('attenuationDistance', opts.attenuationDistance, Number.MIN_VALUE);\n if (\n attenuationColor.length !== 3 ||\n attenuationColor.some((value) => !Number.isFinite(value) || value < 0 || value > 1)\n ) {\n throw new MaterialTransmissionContractError('attenuationColor', 'shape', attenuationColor);\n }\n if (transmission > 0 && opts.renderState?.blend !== undefined) {\n throw new MaterialTransmissionContractError('transmission', 'blend', opts.renderState.blend);\n }\n if (transmission > 0 && opts.renderState?.depthWriteEnabled === true) {\n throw new MaterialTransmissionContractError('transmission', 'depth-write', true);\n }\n const values: Record<string, MaterialValue> = {\n baseColor: opts.baseColor,\n metallic: opts.metallic ?? 0,\n roughness: opts.roughness ?? 0.5,\n occlusionStrength,\n specularTint: opts.specularTint ?? [1, 1, 1],\n transmission,\n ior,\n thickness,\n attenuationColor,\n };\n if (opts.metallicChannel !== undefined) values.metallicChannel = opts.metallicChannel;\n if (opts.roughnessChannel !== undefined) values.roughnessChannel = opts.roughnessChannel;\n if (opts.clearcoat !== undefined) values.clearcoat = opts.clearcoat;\n if (opts.clearcoatRoughness !== undefined) values.clearcoatRoughness = opts.clearcoatRoughness;\n if (opts.emissive !== undefined) values.emissive = opts.emissive;\n if (opts.emissiveIntensity !== undefined) values.emissiveIntensity = opts.emissiveIntensity;\n if (opts.emissiveTexture !== undefined) values.emissiveTexture = opts.emissiveTexture;\n if (opts.baseColorTexture !== undefined) values.baseColorTexture = opts.baseColorTexture;\n if (opts.metallicRoughnessTexture !== undefined) {\n values.metallicRoughnessTexture = opts.metallicRoughnessTexture;\n }\n if (opts.normalTexture !== undefined) values.normalTexture = opts.normalTexture;\n if (opts.occlusionTexture !== undefined) values.occlusionTexture = opts.occlusionTexture;\n if (opts.specularTintTexture !== undefined) {\n values.specularTintTexture = opts.specularTintTexture;\n }\n if (opts.alphaCutoff !== undefined) values.alphaCutoff = opts.alphaCutoff;\n if (opts.transmissionTexture !== undefined) values.transmissionTexture = opts.transmissionTexture;\n if (opts.thicknessTexture !== undefined) values.thicknessTexture = opts.thicknessTexture;\n if (opts.attenuationDistance !== undefined) values.attenuationDistance = opts.attenuationDistance;\n const forwardRenderState =\n transmission > 0 ? { ...(opts.renderState ?? {}), depthWriteEnabled: false } : opts.renderState;\n const passes: [MaterialPass, ...MaterialPass[]] = [\n pass('forward', STANDARD_MODULE, forwardRenderState, 'fs_main', opts.queue),\n ];\n if (transmission === 0) {\n passes.push(pass('deferred', STANDARD_MODULE, opts.renderState, 'fs_gbuffer', opts.queue));\n }\n if (opts.castShadow !== false) passes.push(pass('shadow-caster', STANDARD_MODULE, undefined));\n return {\n kind: 'material',\n ...(opts.colorSpace === undefined || opts.colorSpace === 'srgb'\n ? {}\n : { colorSpace: opts.colorSpace }),\n passes,\n parameters: standardParameters(opts.colorSpace ?? 'srgb'),\n values,\n };\n}\n\nexport const Materials = { unlit, standard } as const;\n\nexport { SPRITE_MODULE };\n"]}