@carbonenginejs/runtime-resource 0.10.0 → 0.11.1

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 (254) hide show
  1. package/dist/format/effect/effectPermutationGraph.js +257 -0
  2. package/dist/format/effect/effectPermutationGraph.js.map +1 -0
  3. package/dist/format/effect/effectReflectionPackage.js +636 -0
  4. package/dist/format/effect/effectReflectionPackage.js.map +1 -0
  5. package/dist/format/effect/sha256.js +114 -0
  6. package/dist/format/effect/sha256.js.map +1 -0
  7. package/dist/formats/dxbc/CjsDxbcFormat.js +142 -0
  8. package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -0
  9. package/dist/formats/dxbc/core/DxbcReader.js +266 -0
  10. package/dist/formats/dxbc/core/DxbcReader.js.map +1 -0
  11. package/dist/formats/dxbc/core/container.js +169 -0
  12. package/dist/formats/dxbc/core/container.js.map +1 -0
  13. package/dist/formats/dxbc/core/decoder.js +789 -0
  14. package/dist/formats/dxbc/core/decoder.js.map +1 -0
  15. package/dist/formats/dxbc/core/errors.js +19 -0
  16. package/dist/formats/dxbc/core/errors.js.map +1 -0
  17. package/dist/formats/dxbc/core/helpers.js +220 -0
  18. package/dist/formats/dxbc/core/helpers.js.map +1 -0
  19. package/dist/formats/dxbc/core/opcodes.js +45 -0
  20. package/dist/formats/dxbc/core/opcodes.js.map +1 -0
  21. package/dist/formats/dxbc/core/program.js +91 -0
  22. package/dist/formats/dxbc/core/program.js.map +1 -0
  23. package/dist/formats/dxbc/core/signature.js +172 -0
  24. package/dist/formats/dxbc/core/signature.js.map +1 -0
  25. package/dist/formats/dxbc/index.js +2 -0
  26. package/dist/formats/dxbc/index.js.map +1 -0
  27. package/dist/formats/hlsl/CjsHlslFormat.js +254 -0
  28. package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -0
  29. package/dist/formats/hlsl/core/HlslBinaryUtils.js +15 -0
  30. package/dist/formats/hlsl/core/HlslBinaryUtils.js.map +1 -0
  31. package/dist/formats/hlsl/core/HlslEffectReadError.js +19 -0
  32. package/dist/formats/hlsl/core/HlslEffectReadError.js.map +1 -0
  33. package/dist/formats/hlsl/core/HlslEffectStateManager.js +130 -0
  34. package/dist/formats/hlsl/core/HlslEffectStateManager.js.map +1 -0
  35. package/dist/formats/hlsl/core/HlslReader.js +266 -0
  36. package/dist/formats/hlsl/core/HlslReader.js.map +1 -0
  37. package/dist/formats/hlsl/core/HlslRenderStateSetup.js +37 -0
  38. package/dist/formats/hlsl/core/HlslRenderStateSetup.js.map +1 -0
  39. package/dist/formats/hlsl/core/HlslResourceSetDescription.js +94 -0
  40. package/dist/formats/hlsl/core/HlslResourceSetDescription.js.map +1 -0
  41. package/dist/formats/hlsl/core/HlslShaderBytecode.js +44 -0
  42. package/dist/formats/hlsl/core/HlslShaderBytecode.js.map +1 -0
  43. package/dist/formats/hlsl/core/analysis.js +51 -0
  44. package/dist/formats/hlsl/core/analysis.js.map +1 -0
  45. package/dist/formats/hlsl/core/helpers.js +270 -0
  46. package/dist/formats/hlsl/core/helpers.js.map +1 -0
  47. package/dist/formats/hlsl/core/json.js +284 -0
  48. package/dist/formats/hlsl/core/json.js.map +1 -0
  49. package/dist/formats/hlsl/core/metadata.js +327 -0
  50. package/dist/formats/hlsl/core/metadata.js.map +1 -0
  51. package/dist/formats/hlsl/core/portableReflection.js +848 -0
  52. package/dist/formats/hlsl/core/portableReflection.js.map +1 -0
  53. package/dist/formats/hlsl/core/render-states.js +280 -0
  54. package/dist/formats/hlsl/core/render-states.js.map +1 -0
  55. package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js +43 -0
  56. package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js.map +1 -0
  57. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +294 -0
  58. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -0
  59. package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js +33 -0
  60. package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js.map +1 -0
  61. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +416 -0
  62. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js.map +1 -0
  63. package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js +40 -0
  64. package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js.map +1 -0
  65. package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js +742 -0
  66. package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js.map +1 -0
  67. package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js +52 -0
  68. package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js.map +1 -0
  69. package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js +38 -0
  70. package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js.map +1 -0
  71. package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js +50 -0
  72. package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js.map +1 -0
  73. package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +86 -0
  74. package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -0
  75. package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js +31 -0
  76. package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js.map +1 -0
  77. package/dist/formats/hlsl/core/tr2/shader/HlslPass.js +42 -0
  78. package/dist/formats/hlsl/core/tr2/shader/HlslPass.js.map +1 -0
  79. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js +55 -0
  80. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js.map +1 -0
  81. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js +29 -0
  82. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js.map +1 -0
  83. package/dist/formats/hlsl/core/tr2/shader/HlslShader.js +220 -0
  84. package/dist/formats/hlsl/core/tr2/shader/HlslShader.js.map +1 -0
  85. package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js +30 -0
  86. package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js.map +1 -0
  87. package/dist/formats/hlsl/index.js +2 -0
  88. package/dist/formats/hlsl/index.js.map +1 -0
  89. package/dist/formats/hlsl/portable.js +2 -0
  90. package/dist/formats/hlsl/portable.js.map +1 -0
  91. package/dist/formats/index.js +4 -0
  92. package/dist/formats/index.js.map +1 -1
  93. package/dist/formats/webgl/CjsWebglFormat.js +221 -0
  94. package/dist/formats/webgl/CjsWebglFormat.js.map +1 -0
  95. package/dist/formats/webgl/core/cewg/CewgPackage.js +339 -0
  96. package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -0
  97. package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js +104 -0
  98. package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js.map +1 -0
  99. package/dist/formats/webgl/core/cewg/binary.js +101 -0
  100. package/dist/formats/webgl/core/cewg/binary.js.map +1 -0
  101. package/dist/formats/webgl/core/cewgCompleteness.js +81 -0
  102. package/dist/formats/webgl/core/cewgCompleteness.js.map +1 -0
  103. package/dist/formats/webgl/core/effectPackage.js +789 -0
  104. package/dist/formats/webgl/core/effectPackage.js.map +1 -0
  105. package/dist/formats/webgl/core/effectPackageValidation.js +331 -0
  106. package/dist/formats/webgl/core/effectPackageValidation.js.map +1 -0
  107. package/dist/formats/webgl/core/errors.js +27 -0
  108. package/dist/formats/webgl/core/errors.js.map +1 -0
  109. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +2678 -0
  110. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -0
  111. package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js +89 -0
  112. package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +1 -0
  113. package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +428 -0
  114. package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -0
  115. package/dist/formats/webgl/core/helpers.js +306 -0
  116. package/dist/formats/webgl/core/helpers.js.map +1 -0
  117. package/dist/formats/webgl/index.js +2 -0
  118. package/dist/formats/webgl/index.js.map +1 -0
  119. package/dist/formats/webgpu/CjsWebgpuFormat.js +376 -0
  120. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -0
  121. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +415 -0
  122. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +1 -0
  123. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +100 -0
  124. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +1 -0
  125. package/dist/formats/webgpu/core/cewgpu/binary.js +93 -0
  126. package/dist/formats/webgpu/core/cewgpu/binary.js.map +1 -0
  127. package/dist/formats/webgpu/core/cewgpu/tags.js +17 -0
  128. package/dist/formats/webgpu/core/cewgpu/tags.js.map +1 -0
  129. package/dist/formats/webgpu/core/effectAnalysis.js +82 -0
  130. package/dist/formats/webgpu/core/effectAnalysis.js.map +1 -0
  131. package/dist/formats/webgpu/core/effectBackendBodySet.js +305 -0
  132. package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -0
  133. package/dist/formats/webgpu/core/effectPackageValidation.js +1078 -0
  134. package/dist/formats/webgpu/core/effectPackageValidation.js.map +1 -0
  135. package/dist/formats/webgpu/core/errors.js +20 -0
  136. package/dist/formats/webgpu/core/errors.js.map +1 -0
  137. package/dist/formats/webgpu/core/helpers.js +448 -0
  138. package/dist/formats/webgpu/core/helpers.js.map +1 -0
  139. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +223 -0
  140. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -0
  141. package/dist/formats/webgpu/core/ir/buildControlFlow.js +220 -0
  142. package/dist/formats/webgpu/core/ir/buildControlFlow.js.map +1 -0
  143. package/dist/formats/webgpu/core/ir/indexableTemps.js +137 -0
  144. package/dist/formats/webgpu/core/ir/indexableTemps.js.map +1 -0
  145. package/dist/formats/webgpu/core/ir/inferValueTypes.js +454 -0
  146. package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -0
  147. package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js +494 -0
  148. package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -0
  149. package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js +177 -0
  150. package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js.map +1 -0
  151. package/dist/formats/webgpu/core/ir/sourceLanes.js +61 -0
  152. package/dist/formats/webgpu/core/ir/sourceLanes.js.map +1 -0
  153. package/dist/formats/webgpu/core/packageEffect.js +300 -0
  154. package/dist/formats/webgpu/core/packageEffect.js.map +1 -0
  155. package/dist/formats/webgpu/core/packageEffectSelection.js +164 -0
  156. package/dist/formats/webgpu/core/packageEffectSelection.js.map +1 -0
  157. package/dist/formats/webgpu/core/packageMetadata.js +8 -0
  158. package/dist/formats/webgpu/core/packageMetadata.js.map +1 -0
  159. package/dist/formats/webgpu/core/schema.js +4 -0
  160. package/dist/formats/webgpu/core/schema.js.map +1 -0
  161. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +275 -0
  162. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -0
  163. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +182 -0
  164. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -0
  165. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +324 -0
  166. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -0
  167. package/dist/formats/webgpu/core/wgsl/emitWgsl.js +356 -0
  168. package/dist/formats/webgpu/core/wgsl/emitWgsl.js.map +1 -0
  169. package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js +77 -0
  170. package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js.map +1 -0
  171. package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js +451 -0
  172. package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -0
  173. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +754 -0
  174. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -0
  175. package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +457 -0
  176. package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -0
  177. package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js +1572 -0
  178. package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js.map +1 -0
  179. package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js +659 -0
  180. package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js.map +1 -0
  181. package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js +734 -0
  182. package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js.map +1 -0
  183. package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js +583 -0
  184. package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js.map +1 -0
  185. package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js +621 -0
  186. package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js.map +1 -0
  187. package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js +824 -0
  188. package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js.map +1 -0
  189. package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js +697 -0
  190. package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js.map +1 -0
  191. package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js +559 -0
  192. package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js.map +1 -0
  193. package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js +1328 -0
  194. package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js.map +1 -0
  195. package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js +110 -0
  196. package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js.map +1 -0
  197. package/dist/formats/webgpu/core/wgsl/precisionControls.js +55 -0
  198. package/dist/formats/webgpu/core/wgsl/precisionControls.js.map +1 -0
  199. package/dist/formats/webgpu/core/wgsl/selectionPlans.js +758 -0
  200. package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -0
  201. package/dist/formats/webgpu/core/wgsl/uniformity.js +78 -0
  202. package/dist/formats/webgpu/core/wgsl/uniformity.js.map +1 -0
  203. package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js +196 -0
  204. package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js.map +1 -0
  205. package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js +37 -0
  206. package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js.map +1 -0
  207. package/dist/formats/webgpu/index.js +2 -0
  208. package/dist/formats/webgpu/index.js.map +1 -0
  209. package/dist/resource/shader/Tr2EffectRes.js +159 -150
  210. package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
  211. package/dist/resource/shader/Tr2MaterialArea.js +23 -28
  212. package/dist/resource/shader/Tr2MaterialArea.js.map +1 -1
  213. package/dist/resource/shader/Tr2MaterialMesh.js +21 -27
  214. package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -1
  215. package/dist/resource/shader/Tr2MaterialRes.js +24 -29
  216. package/dist/resource/shader/Tr2MaterialRes.js.map +1 -1
  217. package/dist/resource/shader/Tr2Shader.js +45 -39
  218. package/dist/resource/shader/Tr2Shader.js.map +1 -1
  219. package/dist/resource/shader/Tr2ShaderPermutation.js +30 -32
  220. package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -1
  221. package/dist/resource/shader/reflection/Tr2EffectConstant.js +113 -78
  222. package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
  223. package/dist/resource/shader/reflection/Tr2EffectDefine.js +17 -23
  224. package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -1
  225. package/dist/resource/shader/reflection/Tr2EffectDescription.js +23 -29
  226. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
  227. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +44 -40
  228. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
  229. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +82 -86
  230. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
  231. package/dist/resource/shader/reflection/Tr2EffectResource.js +55 -61
  232. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  233. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +49 -45
  234. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
  235. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +25 -30
  236. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
  237. package/dist/resource/shader/reflection/Tr2Pass.js +30 -32
  238. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  239. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +21 -26
  240. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
  241. package/docs/formats/README.md +4 -0
  242. package/docs/formats/provenance.md +11 -3
  243. package/docs/reference/classes/formats.md +440 -0
  244. package/format-notices/dxbc/LICENSE +21 -0
  245. package/format-notices/dxbc/NOTICE +20 -0
  246. package/format-notices/hlsl/LICENSE +21 -0
  247. package/format-notices/hlsl/NOTICE +25 -0
  248. package/format-notices/webgl/LICENSE +21 -0
  249. package/format-notices/webgl/NOTICE +35 -0
  250. package/format-notices/webgpu/LICENSE +21 -0
  251. package/format-notices/webgpu/NOTICE +31 -0
  252. package/package.json +6 -1
  253. package/dist/resource/shader/portableValidation.js +0 -461
  254. package/dist/resource/shader/portableValidation.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effectReflectionPackage.js","sources":["../../../../src/format/effect/effectReflectionPackage.js"],"sourcesContent":["import {\n buildEffectBodyReflection,\n EFFECT_BODY_REFLECTION_FORMAT,\n EFFECT_BODY_REFLECTION_VERSION,\n enumerateUniqueEffectBodies,\n validateEffectBodyReflection\n} from \"../../formats/hlsl/portable.js\";\n\nimport { sha256Bytes, sha256Utf8 } from \"./sha256.js\";\n\nexport const EFFECT_REFLECTION_CHUNK = \"RFLX\";\nexport const EFFECT_REFLECTION_BLOB_CHUNK = \"RBLB\";\nexport const EFFECT_REFLECTION_FORMAT = \"CJS_EFFECT_REFLECTION\";\nexport const EFFECT_REFLECTION_VERSION = 2;\n\nconst SHA256 = /^[0-9a-f]{64}$/u;\nconst SELECTED_EFFECT_REFLECTION_VERSION = 1;\n\n/**\n * Build selected-body source reflection plus its deduplicated binary store.\n *\n * @param {object} effectRes Loaded format-hlsl Tr2EffectRes.\n * @param {number} permutationIndex Exact selected permutation-table index.\n * @param {object} permutationGraph Complete source PGRF document.\n * @param {object} options Source identity and diagnostic label.\n * @param {object} options.sourceIdentity Canonical INFO source identity.\n * @param {string} options.sourcePath Diagnostic INFO/META/ANLS source label.\n * @returns {{reflection:object,blobBytes:Uint8Array,pointer:object,counts:object}}\n * Frozen reflection documents and owned blob bytes.\n */\nexport function buildSelectedEffectReflection(\n effectRes,\n permutationIndex,\n permutationGraph,\n options\n)\n{\n const portable = buildEffectBodyReflection(effectRes, permutationIndex);\n const portableCounts = validateEffectBodyReflection(portable);\n const sourceBytes = effectRes.m_data;\n if (!(sourceBytes instanceof Uint8Array)\n || options?.sourceIdentity?.byteLength !== sourceBytes.byteLength\n || options?.sourceIdentity?.sha256 !== sha256Bytes(sourceBytes))\n {\n throw new Error(\n \"Selected effect reflection source identity disagrees with exact source bytes\"\n );\n }\n const store = new ReflectionBlobStore();\n const source = {\n label: portable.source.label,\n effectVersion: portable.source.effectVersion,\n compilerVersion: portable.source.compilerVersion,\n nativeHash: store.add(portable.source.nativeHash),\n stringTableByteLength: portable.source.stringTableByteLength,\n byteLength: portable.source.byteLength,\n sha256: options?.sourceIdentity?.sha256\n };\n const effect = packByteArrays(portable.effect, store);\n const blobBytes = store.finish();\n const variant = selectedVariant(permutationGraph, permutationIndex);\n const body = selectedBody(permutationGraph, variant.bodyKey);\n const exactBodyBytes = sourceBytes.subarray(\n portable.sourceRecord.offset,\n portable.sourceRecord.offset + portable.sourceRecord.byteLength\n );\n if (body.byteLength !== exactBodyBytes.byteLength\n || body.sha256 !== sha256Bytes(exactBodyBytes))\n {\n throw new Error(\n \"Selected effect reflection PGRF body identity disagrees with exact source bytes\"\n );\n }\n const reflection = {\n format: EFFECT_REFLECTION_FORMAT,\n formatVersion: SELECTED_EFFECT_REFLECTION_VERSION,\n portableFormat: EFFECT_BODY_REFLECTION_FORMAT,\n portableFormatVersion: EFFECT_BODY_REFLECTION_VERSION,\n keyScope: portable.keyScope,\n coverage: {\n bodies: \"selected\",\n reflection: \"complete-for-listed\",\n sourcePrograms: \"complete-for-listed\",\n constantDefaults: \"exact-for-listed\"\n },\n selectedBody: {\n permutationIndex,\n bodyKey: variant.bodyKey,\n sourceRecord: {\n offset: portable.sourceRecord.offset,\n byteLength: portable.sourceRecord.byteLength\n },\n byteLength: body.byteLength,\n sha256: body.sha256\n },\n source,\n effect,\n blobStore: {\n chunk: EFFECT_REFLECTION_BLOB_CHUNK,\n byteLength: blobBytes.byteLength,\n sha256: sha256Bytes(blobBytes),\n blobCount: store.entries.length,\n blobs: store.entries.map((entry) => ({ ...entry }))\n }\n };\n const counts = validateSelectedEffectReflection(\n reflection,\n blobBytes,\n {\n permutationGraph,\n permutationIndex,\n sourceIdentity: options?.sourceIdentity,\n sourcePath: options?.sourcePath\n }\n );\n if (counts.sourceProgramCount !== portableCounts.sourceProgramCount)\n {\n throw new Error(\n \"Selected effect reflection source-program count changed while packing\"\n );\n }\n const pointer = {\n chunk: EFFECT_REFLECTION_CHUNK,\n format: EFFECT_REFLECTION_FORMAT,\n formatVersion: SELECTED_EFFECT_REFLECTION_VERSION,\n blobChunk: EFFECT_REFLECTION_BLOB_CHUNK,\n bodyCount: 1,\n sourceProgramCount: counts.sourceProgramCount,\n blobCount: counts.blobCount,\n blobByteLength: counts.blobByteLength\n };\n\n return Object.freeze({\n reflection: deepFreeze(reflection),\n blobBytes,\n pointer: Object.freeze(pointer),\n counts\n });\n}\n\n/**\n * Build complete unique-body source reflection plus one deduplicated byte\n * arena while retaining body-local portable keys.\n *\n * @param {object} effectRes Loaded format-hlsl Tr2EffectRes.\n * @param {object} permutationGraph Complete source PGRF document.\n * @param {object} options Source identity and diagnostic label.\n * @param {object} options.sourceIdentity Canonical INFO source identity.\n * @param {string} options.sourcePath Diagnostic INFO/META/ANLS source label.\n * @returns {{reflection:object,blobBytes:Uint8Array,pointer:object,counts:object}}\n * Frozen all-unique reflection documents and owned blob bytes.\n */\nexport function buildCompleteEffectReflection(\n effectRes,\n permutationGraph,\n options\n)\n{\n const sourceBytes = effectRes?.m_data;\n if (!(sourceBytes instanceof Uint8Array)\n || options?.sourceIdentity?.byteLength !== sourceBytes.byteLength\n || options?.sourceIdentity?.sha256 !== sha256Bytes(sourceBytes))\n {\n throw new Error(\n \"Complete effect reflection source identity disagrees with exact source bytes\"\n );\n }\n\n const inventory = enumerateUniqueEffectBodies(effectRes);\n if (inventory.length !== permutationGraph?.bodies?.length)\n {\n throw new Error(\n \"Complete effect reflection body inventory disagrees with PGRF\"\n );\n }\n\n const store = new ReflectionBlobStore();\n let source = null;\n const bodies = inventory.map((group, bodyIndex) =>\n {\n const graphBody = permutationGraph.bodies[bodyIndex];\n const representative = selectedVariant(\n permutationGraph,\n group.permutationIndex\n );\n if (representative.bodyKey !== graphBody?.key\n || group.variants.some((variant) =>\n {\n const graphVariant = selectedVariant(\n permutationGraph,\n variant.permutationIndex\n );\n return graphVariant.bodyKey !== graphBody.key\n || graphVariant.sourceRecord.offset\n !== variant.sourceRecord.offset\n || graphVariant.sourceRecord.byteLength\n !== variant.sourceRecord.byteLength;\n }))\n {\n throw new Error(\n `Complete effect reflection body ${bodyIndex} aliases disagree with PGRF`\n );\n }\n\n const portable = buildEffectBodyReflection(\n effectRes,\n group.permutationIndex\n );\n if (portable.sourceRecord.offset !== group.sourceRecord.offset\n || portable.sourceRecord.byteLength !== group.sourceRecord.byteLength)\n {\n throw new Error(\n `Complete effect reflection body ${bodyIndex} source record changed`\n );\n }\n if (!source)\n {\n source = {\n label: portable.source.label,\n effectVersion: portable.source.effectVersion,\n compilerVersion: portable.source.compilerVersion,\n nativeHash: store.add(portable.source.nativeHash),\n stringTableByteLength: portable.source.stringTableByteLength,\n byteLength: portable.source.byteLength,\n sha256: options.sourceIdentity.sha256\n };\n }\n else if (!samePortableSource(source, portable.source, store))\n {\n throw new Error(\n `Complete effect reflection body ${bodyIndex} source envelope changed`\n );\n }\n\n const exactBodyBytes = sourceBytes.subarray(\n portable.sourceRecord.offset,\n portable.sourceRecord.offset + portable.sourceRecord.byteLength\n );\n if (graphBody.byteLength !== exactBodyBytes.byteLength\n || graphBody.sha256 !== sha256Bytes(exactBodyBytes))\n {\n throw new Error(\n `Complete effect reflection body ${bodyIndex} identity disagrees with PGRF`\n );\n }\n return {\n bodyKey: graphBody.key,\n representativePermutationIndex: group.permutationIndex,\n byteLength: graphBody.byteLength,\n sha256: graphBody.sha256,\n effect: packByteArrays(portable.effect, store)\n };\n });\n const blobBytes = store.finish();\n const reflection = {\n format: EFFECT_REFLECTION_FORMAT,\n formatVersion: EFFECT_REFLECTION_VERSION,\n portableFormat: EFFECT_BODY_REFLECTION_FORMAT,\n portableFormatVersion: EFFECT_BODY_REFLECTION_VERSION,\n keyScope: \"body-local\",\n coverage: {\n bodies: \"all-unique\",\n reflection: \"complete-for-listed\",\n sourcePrograms: \"complete-for-listed\",\n constantDefaults: \"exact-for-listed\"\n },\n source,\n bodies,\n blobStore: {\n chunk: EFFECT_REFLECTION_BLOB_CHUNK,\n byteLength: blobBytes.byteLength,\n sha256: sha256Bytes(blobBytes),\n blobCount: store.entries.length,\n blobs: store.entries.map((entry) => ({ ...entry }))\n }\n };\n const counts = validateCompleteEffectReflection(\n reflection,\n blobBytes,\n {\n permutationGraph,\n sourceIdentity: options.sourceIdentity,\n sourcePath: options.sourcePath\n }\n );\n const pointer = {\n chunk: EFFECT_REFLECTION_CHUNK,\n format: EFFECT_REFLECTION_FORMAT,\n formatVersion: EFFECT_REFLECTION_VERSION,\n blobChunk: EFFECT_REFLECTION_BLOB_CHUNK,\n sha256: sha256Utf8(`${JSON.stringify(reflection)}\\n`),\n coverage: \"all-unique\",\n permutationCount: permutationGraph.variants.length,\n bodyCount: counts.bodyCount,\n sourceProgramCount: counts.sourceProgramCount,\n blobCount: counts.blobCount,\n blobByteLength: counts.blobByteLength\n };\n\n return Object.freeze({\n reflection: deepFreeze(reflection),\n blobBytes,\n pointer: Object.freeze(pointer),\n counts\n });\n}\n\n/**\n * Validate selected-body reflection against its binary store, PGRF, and INFO\n * source identity.\n *\n * @param {object} reflection Parsed RFLX document.\n * @param {Uint8Array} blobBytes Raw RBLB chunk bytes.\n * @param {object} options Reconciliation context.\n * @param {object} options.permutationGraph Validated complete PGRF document.\n * @param {number} options.permutationIndex Package-selected permutation index.\n * @param {object} options.sourceIdentity Validated INFO source identity.\n * @param {string} options.sourcePath Validated INFO source label.\n * @returns {{bodyCount:number,sourceProgramCount:number,blobCount:number,blobByteLength:number}}\n * Validated selected reflection counts.\n */\nexport function validateSelectedEffectReflection(\n reflection,\n blobBytes,\n options\n)\n{\n requireExactKeys(reflection, [\n \"format\",\n \"formatVersion\",\n \"portableFormat\",\n \"portableFormatVersion\",\n \"keyScope\",\n \"coverage\",\n \"selectedBody\",\n \"source\",\n \"effect\",\n \"blobStore\"\n ], \"CEWGPU RFLX\");\n requireExactKeys(reflection.coverage, [\n \"bodies\",\n \"reflection\",\n \"sourcePrograms\",\n \"constantDefaults\"\n ], \"CEWGPU RFLX.coverage\");\n if (reflection.format !== EFFECT_REFLECTION_FORMAT\n || reflection.formatVersion !== SELECTED_EFFECT_REFLECTION_VERSION\n || reflection.portableFormat !== EFFECT_BODY_REFLECTION_FORMAT\n || reflection.portableFormatVersion !== EFFECT_BODY_REFLECTION_VERSION\n || reflection.keyScope !== \"body-local\"\n || reflection.coverage.bodies !== \"selected\"\n || reflection.coverage.reflection !== \"complete-for-listed\"\n || reflection.coverage.sourcePrograms !== \"complete-for-listed\"\n || reflection.coverage.constantDefaults !== \"exact-for-listed\")\n {\n throw new Error(\"CEWGPU RFLX schema or coverage is unsupported\");\n }\n\n const graph = requireRecord(\n options?.permutationGraph,\n \"CEWGPU RFLX permutation graph\"\n );\n const sourceIdentity = requireRecord(\n options?.sourceIdentity,\n \"CEWGPU RFLX source identity\"\n );\n const sourcePath = requireString(\n options?.sourcePath,\n \"CEWGPU RFLX sourcePath\"\n );\n const selected = requireRecord(\n reflection.selectedBody,\n \"CEWGPU RFLX.selectedBody\"\n );\n requireExactKeys(selected, [\n \"permutationIndex\",\n \"bodyKey\",\n \"sourceRecord\",\n \"byteLength\",\n \"sha256\"\n ], \"CEWGPU RFLX.selectedBody\");\n requireUint(selected.permutationIndex, \"CEWGPU RFLX selected permutationIndex\");\n if (selected.permutationIndex !== options?.permutationIndex)\n {\n throw new Error(\"CEWGPU RFLX selected body disagrees with META\");\n }\n requireString(selected.bodyKey, \"CEWGPU RFLX selected bodyKey\");\n requireUint(selected.byteLength, \"CEWGPU RFLX selected byteLength\", true);\n requireSha256(selected.sha256, \"CEWGPU RFLX selected sha256\");\n const sourceRecord = requireRecord(\n selected.sourceRecord,\n \"CEWGPU RFLX selected sourceRecord\"\n );\n requireExactKeys(\n sourceRecord,\n [ \"offset\", \"byteLength\" ],\n \"CEWGPU RFLX selected sourceRecord\"\n );\n requireUint(sourceRecord.offset, \"CEWGPU RFLX selected sourceRecord offset\");\n requireUint(\n sourceRecord.byteLength,\n \"CEWGPU RFLX selected sourceRecord byteLength\",\n true\n );\n\n const variant = selectedVariant(graph, selected.permutationIndex);\n const body = selectedBody(graph, selected.bodyKey);\n if (variant.bodyKey !== selected.bodyKey\n || variant.sourceRecord.offset !== sourceRecord.offset\n || variant.sourceRecord.byteLength !== sourceRecord.byteLength\n || selected.byteLength !== body.byteLength\n || sourceRecord.byteLength !== body.byteLength\n || selected.sha256 !== body.sha256)\n {\n throw new Error(\"CEWGPU RFLX selected body disagrees with PGRF\");\n }\n\n const source = requireRecord(reflection.source, \"CEWGPU RFLX.source\");\n requireExactKeys(source, [\n \"label\",\n \"effectVersion\",\n \"compilerVersion\",\n \"nativeHash\",\n \"stringTableByteLength\",\n \"byteLength\",\n \"sha256\"\n ], \"CEWGPU RFLX.source\");\n if (source.label !== sourcePath\n || source.byteLength !== sourceIdentity.byteLength\n || source.sha256 !== sourceIdentity.sha256)\n {\n throw new Error(\"CEWGPU RFLX source identity disagrees with INFO\");\n }\n requireSha256(source.sha256, \"CEWGPU RFLX source sha256\");\n\n const blobInventory = validateBlobStore(reflection.blobStore, blobBytes);\n const usedBlobKeys = new Set();\n const portable = {\n format: reflection.portableFormat,\n formatVersion: reflection.portableFormatVersion,\n mode: \"single-body\",\n keyScope: reflection.keyScope,\n coverage: {\n bodies: \"single\",\n reflection: \"complete\",\n sourcePrograms: \"complete\",\n constantDefaults: \"exact\"\n },\n source: {\n label: source.label,\n effectVersion: source.effectVersion,\n compilerVersion: source.compilerVersion,\n nativeHash: unpackBlobReference(\n source.nativeHash,\n blobInventory,\n blobBytes,\n usedBlobKeys\n ),\n stringTableByteLength: source.stringTableByteLength,\n byteLength: source.byteLength\n },\n permutationIndex: selected.permutationIndex,\n sourceRecord: {\n offset: sourceRecord.offset,\n byteLength: sourceRecord.byteLength\n },\n effect: unpackByteReferences(\n reflection.effect,\n blobInventory,\n blobBytes,\n usedBlobKeys\n )\n };\n const portableCounts = validateEffectBodyReflection(portable);\n if (usedBlobKeys.size !== blobInventory.size)\n {\n throw new Error(\"CEWGPU RFLX blob store contains unreferenced payloads\");\n }\n\n return Object.freeze({\n bodyCount: 1,\n sourceProgramCount: portableCounts.sourceProgramCount,\n blobCount: blobInventory.size,\n blobByteLength: blobBytes.byteLength\n });\n}\n\n/**\n * Validate complete unique-body reflection against PGRF and its shared byte\n * arena.\n *\n * @param {object} reflection Parsed RFLX v2 document.\n * @param {Uint8Array} blobBytes Raw RBLB bytes.\n * @param {object} options Reconciliation context.\n * @param {object} options.permutationGraph Validated complete PGRF document.\n * @param {object} options.sourceIdentity Validated INFO source identity.\n * @param {string} options.sourcePath Validated INFO source label.\n * @returns {{permutationCount:number,bodyCount:number,sourceProgramCount:number,blobCount:number,blobByteLength:number}}\n * Validated complete source-reflection counts.\n */\nexport function validateCompleteEffectReflection(\n reflection,\n blobBytes,\n options\n)\n{\n requireExactKeys(reflection, [\n \"format\",\n \"formatVersion\",\n \"portableFormat\",\n \"portableFormatVersion\",\n \"keyScope\",\n \"coverage\",\n \"source\",\n \"bodies\",\n \"blobStore\"\n ], \"CEWGPU RFLX\");\n requireExactKeys(reflection.coverage, [\n \"bodies\",\n \"reflection\",\n \"sourcePrograms\",\n \"constantDefaults\"\n ], \"CEWGPU RFLX.coverage\");\n if (reflection.format !== EFFECT_REFLECTION_FORMAT\n || reflection.formatVersion !== EFFECT_REFLECTION_VERSION\n || reflection.portableFormat !== EFFECT_BODY_REFLECTION_FORMAT\n || reflection.portableFormatVersion !== EFFECT_BODY_REFLECTION_VERSION\n || reflection.keyScope !== \"body-local\"\n || reflection.coverage.bodies !== \"all-unique\"\n || reflection.coverage.reflection !== \"complete-for-listed\"\n || reflection.coverage.sourcePrograms !== \"complete-for-listed\"\n || reflection.coverage.constantDefaults !== \"exact-for-listed\"\n || !Array.isArray(reflection.bodies))\n {\n throw new Error(\"CEWGPU RFLX schema or coverage is unsupported\");\n }\n\n const graph = requireRecord(\n options?.permutationGraph,\n \"CEWGPU RFLX permutation graph\"\n );\n const sourceIdentity = requireRecord(\n options?.sourceIdentity,\n \"CEWGPU RFLX source identity\"\n );\n const sourcePath = requireString(\n options?.sourcePath,\n \"CEWGPU RFLX sourcePath\"\n );\n if (reflection.bodies.length !== graph.bodies?.length)\n {\n throw new Error(\"CEWGPU RFLX does not cover every PGRF body\");\n }\n\n const source = requireRecord(reflection.source, \"CEWGPU RFLX.source\");\n requireExactKeys(source, [\n \"label\",\n \"effectVersion\",\n \"compilerVersion\",\n \"nativeHash\",\n \"stringTableByteLength\",\n \"byteLength\",\n \"sha256\"\n ], \"CEWGPU RFLX.source\");\n if (source.label !== sourcePath\n || source.byteLength !== sourceIdentity.byteLength\n || source.sha256 !== sourceIdentity.sha256)\n {\n throw new Error(\"CEWGPU RFLX source identity disagrees with INFO\");\n }\n requireSha256(source.sha256, \"CEWGPU RFLX source sha256\");\n\n const blobInventory = validateBlobStore(reflection.blobStore, blobBytes);\n const usedBlobKeys = new Set();\n const nativeHash = unpackBlobReference(\n source.nativeHash,\n blobInventory,\n blobBytes,\n usedBlobKeys\n );\n const representativeByBodyKey = new Map();\n for (const variant of graph.variants)\n {\n if (!representativeByBodyKey.has(variant.bodyKey))\n {\n representativeByBodyKey.set(variant.bodyKey, variant);\n }\n }\n let sourceProgramCount = 0;\n for (const [ bodyIndex, reflectedBody ] of reflection.bodies.entries())\n {\n requireExactKeys(reflectedBody, [\n \"bodyKey\",\n \"representativePermutationIndex\",\n \"byteLength\",\n \"sha256\",\n \"effect\"\n ], `CEWGPU RFLX body ${bodyIndex}`);\n const graphBody = graph.bodies[bodyIndex];\n requireString(reflectedBody.bodyKey, `CEWGPU RFLX body ${bodyIndex} key`);\n requireUint(\n reflectedBody.representativePermutationIndex,\n `CEWGPU RFLX body ${bodyIndex} representative`\n );\n requireUint(\n reflectedBody.byteLength,\n `CEWGPU RFLX body ${bodyIndex} byteLength`,\n true\n );\n requireSha256(\n reflectedBody.sha256,\n `CEWGPU RFLX body ${bodyIndex} sha256`\n );\n const representative = representativeByBodyKey.get(\n reflectedBody.bodyKey\n );\n if (!graphBody\n || reflectedBody.bodyKey !== graphBody.key\n || reflectedBody.byteLength !== graphBody.byteLength\n || reflectedBody.sha256 !== graphBody.sha256\n || !representative\n || reflectedBody.representativePermutationIndex\n !== representative.permutationIndex)\n {\n throw new Error(\n `CEWGPU RFLX body ${bodyIndex} disagrees with PGRF`\n );\n }\n const portable = {\n format: reflection.portableFormat,\n formatVersion: reflection.portableFormatVersion,\n mode: \"single-body\",\n keyScope: reflection.keyScope,\n coverage: {\n bodies: \"single\",\n reflection: \"complete\",\n sourcePrograms: \"complete\",\n constantDefaults: \"exact\"\n },\n source: {\n label: source.label,\n effectVersion: source.effectVersion,\n compilerVersion: source.compilerVersion,\n nativeHash: Uint8Array.from(nativeHash),\n stringTableByteLength: source.stringTableByteLength,\n byteLength: source.byteLength\n },\n permutationIndex: representative.permutationIndex,\n sourceRecord: { ...representative.sourceRecord },\n effect: unpackByteReferences(\n reflectedBody.effect,\n blobInventory,\n blobBytes,\n usedBlobKeys\n )\n };\n sourceProgramCount += validateEffectBodyReflection(portable)\n .sourceProgramCount;\n }\n if (usedBlobKeys.size !== blobInventory.size)\n {\n throw new Error(\"CEWGPU RFLX blob store contains unreferenced payloads\");\n }\n\n return Object.freeze({\n permutationCount: graph.variants.length,\n bodyCount: reflection.bodies.length,\n sourceProgramCount,\n blobCount: blobInventory.size,\n blobByteLength: blobBytes.byteLength\n });\n}\n\n/**\n * Validate an INFO reflection pointer against parsed RFLX/RBLB payloads.\n *\n * @param {object} pointer INFO reflection pointer.\n * @param {object} reflection Parsed RFLX document.\n * @param {Uint8Array} blobBytes Raw RBLB bytes.\n * @param {object} options Reconciliation context for RFLX.\n * @param {Uint8Array} [options.reflectionBytes] Exact RFLX chunk bytes for v2.\n * @returns {object} Validated reflection counts.\n */\nexport function validateEffectReflectionPointer(\n pointer,\n reflection,\n blobBytes,\n options\n)\n{\n const version = pointer?.formatVersion;\n requireExactKeys(pointer, version === EFFECT_REFLECTION_VERSION ? [\n \"chunk\",\n \"format\",\n \"formatVersion\",\n \"blobChunk\",\n \"sha256\",\n \"coverage\",\n \"permutationCount\",\n \"bodyCount\",\n \"sourceProgramCount\",\n \"blobCount\",\n \"blobByteLength\"\n ] : [\n \"chunk\",\n \"format\",\n \"formatVersion\",\n \"blobChunk\",\n \"bodyCount\",\n \"sourceProgramCount\",\n \"blobCount\",\n \"blobByteLength\"\n ], \"CEWGPU INFO.effectReflection\");\n if (pointer.chunk !== EFFECT_REFLECTION_CHUNK\n || pointer.format !== EFFECT_REFLECTION_FORMAT\n || ![\n SELECTED_EFFECT_REFLECTION_VERSION,\n EFFECT_REFLECTION_VERSION\n ].includes(version)\n || pointer.blobChunk !== EFFECT_REFLECTION_BLOB_CHUNK)\n {\n throw new Error(\"CEWGPU INFO.effectReflection is malformed\");\n }\n for (const field of [\n \"bodyCount\",\n \"sourceProgramCount\",\n \"blobCount\",\n \"blobByteLength\"\n ])\n {\n requireUint(pointer[field], `CEWGPU INFO.effectReflection.${field}`);\n }\n\n let counts;\n if (version === EFFECT_REFLECTION_VERSION)\n {\n requireSha256(pointer.sha256, \"CEWGPU INFO.effectReflection.sha256\");\n if (!(options?.reflectionBytes instanceof Uint8Array)\n || sha256Bytes(options.reflectionBytes) !== pointer.sha256)\n {\n throw new Error(\n \"CEWGPU INFO effect-reflection digest disagrees with RFLX\"\n );\n }\n if (pointer.coverage !== \"all-unique\")\n {\n throw new Error(\"CEWGPU INFO.effectReflection is malformed\");\n }\n requireUint(\n pointer.permutationCount,\n \"CEWGPU INFO.effectReflection.permutationCount\",\n true\n );\n counts = validateCompleteEffectReflection(\n reflection,\n blobBytes,\n options\n );\n if (pointer.permutationCount !== counts.permutationCount)\n {\n throw new Error(\n \"CEWGPU INFO effect-reflection counts disagree with RFLX/RBLB\"\n );\n }\n }\n else\n {\n counts = validateSelectedEffectReflection(\n reflection,\n blobBytes,\n options\n );\n }\n if (pointer.bodyCount !== counts.bodyCount\n || pointer.sourceProgramCount !== counts.sourceProgramCount\n || pointer.blobCount !== counts.blobCount\n || pointer.blobByteLength !== counts.blobByteLength)\n {\n throw new Error(\"CEWGPU INFO effect-reflection counts disagree with RFLX/RBLB\");\n }\n return counts;\n}\n\n/**\n * Selects the body-local reflected effect for one PGRF permutation.\n *\n * @param {object} reflection Validated RFLX v1 or v2 document.\n * @param {object} permutationGraph Validated PGRF document.\n * @param {number} permutationIndex Exact package-selected permutation index.\n * @returns {object} Reflected body-local effect graph.\n */\nexport function effectReflectionForPermutation(\n reflection,\n permutationGraph,\n permutationIndex\n)\n{\n const variant = selectedVariant(permutationGraph, permutationIndex);\n if (reflection?.formatVersion === SELECTED_EFFECT_REFLECTION_VERSION)\n {\n if (reflection.selectedBody?.permutationIndex !== permutationIndex\n || reflection.selectedBody?.bodyKey !== variant.bodyKey)\n {\n throw new Error(\"CEWGPU selected RFLX body disagrees with PGRF\");\n }\n return requireRecord(reflection.effect, \"CEWGPU RFLX.effect\");\n }\n if (reflection?.formatVersion === EFFECT_REFLECTION_VERSION)\n {\n const body = reflection.bodies?.find((entry) =>\n entry.bodyKey === variant.bodyKey);\n return requireRecord(body?.effect, \"CEWGPU RFLX selected effect\");\n }\n throw new Error(\"CEWGPU RFLX schema or coverage is unsupported\");\n}\n\n/**\n * Hydrates one package permutation into the validated portable reflection\n * contract owned by format-hlsl.\n *\n * @param {object} reflection Validated RFLX v1 or v2 document.\n * @param {object} permutationGraph Validated PGRF document.\n * @param {number} permutationIndex Exact package permutation index.\n * @param {(reference:object)=>Uint8Array|null} resolveBlob Exact RBLB resolver.\n * @returns {object} Fresh portable single-body reflection with owned bytes.\n */\nexport function hydrateEffectReflectionForPermutation(\n reflection,\n permutationGraph,\n permutationIndex,\n resolveBlob\n)\n{\n if (typeof resolveBlob !== \"function\")\n {\n throw new TypeError(\"CEWGPU reflection blob resolver must be a function\");\n }\n const variant = selectedVariant(permutationGraph, permutationIndex);\n const selected = reflection?.formatVersion\n === SELECTED_EFFECT_REFLECTION_VERSION\n ? reflection.selectedBody\n : variant;\n const cache = new Map();\n const portable = {\n format: reflection?.portableFormat,\n formatVersion: reflection?.portableFormatVersion,\n mode: \"single-body\",\n keyScope: reflection?.keyScope,\n coverage: {\n bodies: \"single\",\n reflection: \"complete\",\n sourcePrograms: \"complete\",\n constantDefaults: \"exact\"\n },\n source: {\n label: reflection?.source?.label,\n effectVersion: reflection?.source?.effectVersion,\n compilerVersion: reflection?.source?.compilerVersion,\n nativeHash: hydrateResolvedBytes(\n reflection?.source?.nativeHash,\n resolveBlob,\n cache\n ),\n stringTableByteLength:\n reflection?.source?.stringTableByteLength,\n byteLength: reflection?.source?.byteLength\n },\n permutationIndex,\n sourceRecord: { ...selected?.sourceRecord },\n effect: hydrateResolvedBytes(\n effectReflectionForPermutation(\n reflection,\n permutationGraph,\n permutationIndex\n ),\n resolveBlob,\n cache\n )\n };\n validateEffectBodyReflection(portable);\n return portable;\n}\n\n/**\n * Builds a deterministic deduplicated byte arena for portable reflection.\n */\nclass ReflectionBlobStore\n{\n /**\n * Initializes an empty first-seen blob inventory.\n */\n constructor()\n {\n this.payloads = [];\n this.entries = [];\n this.byDigest = new Map();\n this.byteLength = 0;\n }\n\n /**\n * Adds exact bytes and returns their canonical immutable reference.\n *\n * @param {Uint8Array} value Portable reflection bytes.\n * @returns {object} Canonical blob reference.\n */\n add(value)\n {\n if (!(value instanceof Uint8Array))\n {\n throw new TypeError(\"Selected effect reflection bytes must be Uint8Array\");\n }\n const bytes = Uint8Array.from(value);\n const sha256 = sha256Bytes(bytes);\n const candidates = this.byDigest.get(sha256) ?? [];\n const existing = candidates.find((candidate) =>\n bytesEqual(candidate.bytes, bytes));\n if (existing)\n {\n return Object.freeze({ ...existing.reference });\n }\n if (candidates.length)\n {\n throw new Error(\"Selected effect reflection SHA-256 collision detected\");\n }\n\n const entry = Object.freeze({\n blobKey: `blob${this.entries.length}`,\n offset: this.byteLength,\n byteLength: bytes.byteLength,\n sha256\n });\n const record = { bytes, reference: entry };\n candidates.push(record);\n this.byDigest.set(sha256, candidates);\n this.payloads.push(bytes);\n this.entries.push(entry);\n this.byteLength += bytes.byteLength;\n return Object.freeze({ ...entry });\n }\n\n /**\n * Materializes the contiguous blob arena in inventory order.\n *\n * @returns {Uint8Array} Owned RBLB payload.\n */\n finish()\n {\n const out = new Uint8Array(this.byteLength);\n let offset = 0;\n for (const bytes of this.payloads)\n {\n out.set(bytes, offset);\n offset += bytes.byteLength;\n }\n return out;\n }\n}\n\nfunction samePortableSource(source, portableSource, store)\n{\n const nativeHash = store.add(portableSource.nativeHash);\n return source.label === portableSource.label\n && source.effectVersion === portableSource.effectVersion\n && source.compilerVersion === portableSource.compilerVersion\n && source.stringTableByteLength === portableSource.stringTableByteLength\n && source.byteLength === portableSource.byteLength\n && source.nativeHash.blobKey === nativeHash.blobKey\n && source.nativeHash.offset === nativeHash.offset\n && source.nativeHash.byteLength === nativeHash.byteLength\n && source.nativeHash.sha256 === nativeHash.sha256;\n}\n\nfunction packByteArrays(value, store)\n{\n if (value instanceof Uint8Array) return store.add(value);\n if (Array.isArray(value))\n {\n return value.map((entry) => packByteArrays(entry, store));\n }\n if (isRecord(value))\n {\n return Object.fromEntries(Object.entries(value).map(([ key, entry ]) => [\n key,\n packByteArrays(entry, store)\n ]));\n }\n return value;\n}\n\nfunction unpackByteReferences(\n value,\n inventory,\n blobBytes,\n usedBlobKeys\n)\n{\n if (isBlobReference(value))\n {\n return unpackBlobReference(\n value,\n inventory,\n blobBytes,\n usedBlobKeys\n );\n }\n if (Array.isArray(value))\n {\n return value.map((entry) =>\n unpackByteReferences(entry, inventory, blobBytes, usedBlobKeys));\n }\n if (isRecord(value))\n {\n return Object.fromEntries(Object.entries(value).map(([ key, entry ]) => [\n key,\n unpackByteReferences(entry, inventory, blobBytes, usedBlobKeys)\n ]));\n }\n return value;\n}\n\nfunction unpackBlobReference(reference, inventory, blobBytes, usedBlobKeys)\n{\n requireExactKeys(reference, [\n \"blobKey\",\n \"offset\",\n \"byteLength\",\n \"sha256\"\n ], \"CEWGPU RFLX blob reference\");\n const entry = inventory.get(reference.blobKey);\n if (!entry\n || reference.offset !== entry.offset\n || reference.byteLength !== entry.byteLength\n || reference.sha256 !== entry.sha256)\n {\n throw new Error(\"CEWGPU RFLX blob reference disagrees with its inventory\");\n }\n usedBlobKeys.add(reference.blobKey);\n return Uint8Array.from(blobBytes.subarray(\n reference.offset,\n reference.offset + reference.byteLength\n ));\n}\n\nfunction validateBlobStore(blobStore, blobBytes)\n{\n requireExactKeys(blobStore, [\n \"chunk\",\n \"byteLength\",\n \"sha256\",\n \"blobCount\",\n \"blobs\"\n ], \"CEWGPU RFLX.blobStore\");\n if (!(blobBytes instanceof Uint8Array))\n {\n throw new Error(\"CEWGPU RBLB must be raw Uint8Array bytes\");\n }\n if (blobStore.chunk !== EFFECT_REFLECTION_BLOB_CHUNK\n || blobStore.byteLength !== blobBytes.byteLength\n || blobStore.sha256 !== sha256Bytes(blobBytes)\n || !Array.isArray(blobStore.blobs)\n || blobStore.blobCount !== blobStore.blobs.length)\n {\n throw new Error(\"CEWGPU RFLX blob-store envelope disagrees with RBLB\");\n }\n requireSha256(blobStore.sha256, \"CEWGPU RFLX blob-store sha256\");\n\n const inventory = new Map();\n const digests = new Set();\n let expectedOffset = 0;\n for (const [ index, entry ] of blobStore.blobs.entries())\n {\n requireExactKeys(entry, [\n \"blobKey\",\n \"offset\",\n \"byteLength\",\n \"sha256\"\n ], `CEWGPU RFLX blob ${index}`);\n if (entry.blobKey !== `blob${index}`)\n {\n throw new Error(`CEWGPU RFLX blob ${index} has a noncanonical key`);\n }\n requireUint(entry.offset, `CEWGPU RFLX blob ${index} offset`);\n requireUint(entry.byteLength, `CEWGPU RFLX blob ${index} byteLength`);\n requireSha256(entry.sha256, `CEWGPU RFLX blob ${index} sha256`);\n const end = entry.offset + entry.byteLength;\n if (entry.offset !== expectedOffset\n || end > blobBytes.byteLength\n || digests.has(entry.sha256)\n || sha256Bytes(blobBytes.subarray(entry.offset, end)) !== entry.sha256)\n {\n throw new Error(`CEWGPU RFLX blob ${index} is malformed or duplicated`);\n }\n inventory.set(entry.blobKey, entry);\n digests.add(entry.sha256);\n expectedOffset = end;\n }\n if (expectedOffset !== blobBytes.byteLength)\n {\n throw new Error(\"CEWGPU RFLX blob inventory does not cover RBLB\");\n }\n return inventory;\n}\n\nfunction selectedVariant(graph, permutationIndex)\n{\n const variant = graph?.variants?.[permutationIndex];\n if (!variant || variant.permutationIndex !== permutationIndex)\n {\n throw new Error(\n `Selected effect reflection body ${permutationIndex} is absent from PGRF`\n );\n }\n return variant;\n}\n\nfunction selectedBody(graph, bodyKey)\n{\n const body = graph?.bodies?.find((entry) => entry.key === bodyKey);\n if (!body)\n {\n throw new Error(`Selected effect reflection body ${bodyKey} is absent from PGRF`);\n }\n return body;\n}\n\nfunction isBlobReference(value)\n{\n return isRecord(value)\n && Object.prototype.hasOwnProperty.call(value, \"blobKey\")\n && Object.prototype.hasOwnProperty.call(value, \"offset\")\n && Object.prototype.hasOwnProperty.call(value, \"byteLength\")\n && Object.prototype.hasOwnProperty.call(value, \"sha256\");\n}\n\nfunction hydrateResolvedBytes(value, resolveBlob, cache)\n{\n if (isBlobReference(value))\n {\n const key = [\n value.blobKey,\n value.offset,\n value.byteLength,\n value.sha256\n ].join(\":\");\n if (!cache.has(key))\n {\n const bytes = resolveBlob(value);\n if (!(bytes instanceof Uint8Array))\n {\n throw new Error(\n `CEWGPU reflection blob ${value.blobKey} is unavailable`\n );\n }\n cache.set(key, bytes);\n }\n return Uint8Array.from(cache.get(key));\n }\n if (Array.isArray(value))\n {\n return value.map((entry) =>\n hydrateResolvedBytes(entry, resolveBlob, cache));\n }\n if (isRecord(value))\n {\n return Object.fromEntries(Object.entries(value).map(([ key, entry ]) => [\n key,\n hydrateResolvedBytes(entry, resolveBlob, cache)\n ]));\n }\n return value;\n}\n\nfunction requireExactKeys(value, allowed, context)\n{\n requireRecord(value, context);\n const keys = Reflect.ownKeys(value);\n if (keys.length !== allowed.length\n || keys.some((key) =>\n typeof key !== \"string\" || !allowed.includes(key)))\n {\n throw new Error(`${context} has unsupported or missing fields`);\n }\n return value;\n}\n\nfunction requireRecord(value, context)\n{\n if (!isRecord(value))\n {\n throw new Error(`${context} must be an object`);\n }\n return value;\n}\n\nfunction requireString(value, context)\n{\n if (typeof value !== \"string\" || !value || value !== value.trim())\n {\n throw new Error(`${context} must be a non-empty string`);\n }\n return value;\n}\n\nfunction requireSha256(value, context)\n{\n if (typeof value !== \"string\" || !SHA256.test(value))\n {\n throw new Error(`${context} must be lowercase SHA-256`);\n }\n return value;\n}\n\nfunction requireUint(value, context, positive = false)\n{\n if (!Number.isSafeInteger(value) || value < (positive ? 1 : 0)\n || value > 0xffffffff)\n {\n throw new Error(`${context} must fit uint32`);\n }\n return value;\n}\n\nfunction isRecord(value)\n{\n return !!value && typeof value === \"object\"\n && !Array.isArray(value) && !ArrayBuffer.isView(value);\n}\n\nfunction bytesEqual(left, right)\n{\n return left.byteLength === right.byteLength\n && left.every((value, index) => value === right[index]);\n}\n\nfunction deepFreeze(value)\n{\n if (!value || typeof value !== \"object\" || Object.isFrozen(value)\n || ArrayBuffer.isView(value))\n {\n return value;\n }\n Object.freeze(value);\n for (const entry of Object.values(value)) deepFreeze(entry);\n return value;\n}\n"],"names":["EFFECT_REFLECTION_CHUNK","EFFECT_REFLECTION_BLOB_CHUNK","EFFECT_REFLECTION_FORMAT","EFFECT_REFLECTION_VERSION","SHA256","SELECTED_EFFECT_REFLECTION_VERSION","buildCompleteEffectReflection","effectRes","permutationGraph","options","sourceBytes","m_data","Uint8Array","sourceIdentity","byteLength","sha256","sha256Bytes","Error","inventory","enumerateUniqueEffectBodies","length","bodies","store","ReflectionBlobStore","source","map","group","bodyIndex","graphBody","representative","selectedVariant","permutationIndex","bodyKey","key","variants","some","variant","graphVariant","sourceRecord","offset","portable","buildEffectBodyReflection","label","effectVersion","compilerVersion","nativeHash","add","stringTableByteLength","samePortableSource","exactBodyBytes","subarray","representativePermutationIndex","effect","packByteArrays","blobBytes","finish","reflection","format","formatVersion","portableFormat","EFFECT_BODY_REFLECTION_FORMAT","portableFormatVersion","EFFECT_BODY_REFLECTION_VERSION","keyScope","coverage","sourcePrograms","constantDefaults","blobStore","chunk","blobCount","entries","blobs","entry","counts","validateCompleteEffectReflection","sourcePath","pointer","blobChunk","sha256Utf8","JSON","stringify","permutationCount","bodyCount","sourceProgramCount","blobByteLength","Object","freeze","deepFreeze","validateSelectedEffectReflection","requireExactKeys","graph","requireRecord","requireString","selected","selectedBody","requireUint","requireSha256","body","blobInventory","validateBlobStore","usedBlobKeys","Set","mode","unpackBlobReference","unpackByteReferences","portableCounts","validateEffectBodyReflection","size","Array","isArray","representativeByBodyKey","Map","has","set","reflectedBody","get","from","validateEffectReflectionPointer","version","includes","field","reflectionBytes","effectReflectionForPermutation","find","hydrateEffectReflectionForPermutation","resolveBlob","TypeError","cache","hydrateResolvedBytes","constructor","payloads","byDigest","value","bytes","candidates","existing","candidate","bytesEqual","reference","blobKey","record","push","out","portableSource","isRecord","fromEntries","isBlobReference","digests","expectedOffset","index","end","prototype","hasOwnProperty","call","join","allowed","context","keys","Reflect","ownKeys","trim","test","positive","Number","isSafeInteger","ArrayBuffer","isView","left","right","every","isFrozen","values"],"mappings":";;;AAUO,MAAMA,uBAAuB,GAAG;AAChC,MAAMC,4BAA4B,GAAG;AACrC,MAAMC,wBAAwB,GAAG;AACjC,MAAMC,yBAAyB,GAAG;AAEzC,MAAMC,MAAM,GAAG,iBAAiB;AAChC,MAAMC,kCAAkC,GAAG,CAAC;;AA4H5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,6BAA6BA,CACzCC,SAAS,EACTC,gBAAgB,EAChBC,OAAO,EAEX;AACI,EAAA,MAAMC,WAAW,GAAGH,SAAS,EAAEI,MAAM;EACrC,IAAI,EAAED,WAAW,YAAYE,UAAU,CAAC,IACjCH,OAAO,EAAEI,cAAc,EAAEC,UAAU,KAAKJ,WAAW,C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uB,KAAK,CAAC,IAAI,CAACiC,WAAW,CAACC,MAAM,CAAClC,KAAK,CAAC;AAC9D;AAEA,SAASK,UAAUA,CAAC8B,IAAI,EAAEC,KAAK,EAC/B;EACI,OAAOD,IAAI,CAACzJ,UAAU,KAAK0J,KAAK,CAAC1J,UAAU,IACpCyJ,IAAI,CAACE,KAAK,CAAC,CAACrC,KAAK,EAAEiB,KAAK,KAAKjB,KAAK,KAAKoC,KAAK,CAACnB,KAAK,CAAC,CAAC;AAC/D;AAEA,SAAS9D,UAAUA,CAAC6C,KAAK,EACzB;EACI,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI/C,MAAM,CAACqF,QAAQ,CAACtC,KAAK,CAAC,IAC1DiC,WAAW,CAACC,MAAM,CAAClC,KAAK,CAAC,EAChC;AACI,IAAA,OAAOA,KAAK;AAChB,EAAA;AACA/C,EAAAA,MAAM,CAACC,MAAM,CAAC8C,KAAK,CAAC;AACpB,EAAA,KAAK,MAAM5D,KAAK,IAAIa,MAAM,CAACsF,MAAM,CAACvC,KAAK,CAAC,EAAE7C,UAAU,CAACf,KAAK,CAAC;AAC3D,EAAA,OAAO4D,KAAK;AAChB;;;;"}
@@ -0,0 +1,114 @@
1
+ const SHA256_CONSTANTS = Object.freeze([0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]);
2
+
3
+ /**
4
+ * Rotate one unsigned 32-bit word right.
5
+ *
6
+ * @param {number} value Unsigned word.
7
+ * @param {number} shift Bit count.
8
+ * @returns {number} Rotated word.
9
+ */
10
+ function rotateRight(value, shift) {
11
+ return value >>> shift | value << 32 - shift;
12
+ }
13
+
14
+ /**
15
+ * Normalize an exact byte range without copying it.
16
+ *
17
+ * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Candidate byte range.
18
+ * @returns {Uint8Array} Exact byte view.
19
+ */
20
+ function normalizeBytes(input) {
21
+ if (input instanceof Uint8Array) {
22
+ return input;
23
+ }
24
+ if (input instanceof ArrayBuffer) {
25
+ return new Uint8Array(input);
26
+ }
27
+ if (ArrayBuffer.isView(input)) {
28
+ return new Uint8Array(input.buffer, input.byteOffset, input.byteLength);
29
+ }
30
+ throw new TypeError("SHA-256 input must be Uint8Array, ArrayBuffer, or ArrayBufferView bytes");
31
+ }
32
+
33
+ /**
34
+ * Browser-safe synchronous SHA-256 over an exact byte view.
35
+ *
36
+ * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Bytes to hash.
37
+ * @returns {string} Lower-case hexadecimal digest.
38
+ */
39
+ function sha256Bytes(input) {
40
+ const inputBytes = normalizeBytes(input);
41
+ const paddedLength = Math.ceil((inputBytes.length + 9) / 64) * 64;
42
+ const bytes = new Uint8Array(paddedLength);
43
+ bytes.set(inputBytes);
44
+ bytes[inputBytes.length] = 0x80;
45
+ let bitLength = BigInt(inputBytes.length) * 8n;
46
+ for (let index = 0; index < 8; index += 1) {
47
+ bytes[paddedLength - 1 - index] = Number(bitLength & 0xffn);
48
+ bitLength >>= 8n;
49
+ }
50
+ const hash = new Uint32Array([0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]);
51
+ const schedule = new Uint32Array(64);
52
+ for (let offset = 0; offset < bytes.length; offset += 64) {
53
+ for (let index = 0; index < 16; index += 1) {
54
+ const word = offset + index * 4;
55
+ schedule[index] = bytes[word] * 0x1000000 + bytes[word + 1] * 0x10000 + bytes[word + 2] * 0x100 + bytes[word + 3] >>> 0;
56
+ }
57
+ for (let index = 16; index < 64; index += 1) {
58
+ const left = schedule[index - 15];
59
+ const right = schedule[index - 2];
60
+ const sigma0 = rotateRight(left, 7) ^ rotateRight(left, 18) ^ left >>> 3;
61
+ const sigma1 = rotateRight(right, 17) ^ rotateRight(right, 19) ^ right >>> 10;
62
+ schedule[index] = schedule[index - 16] + sigma0 + schedule[index - 7] + sigma1 >>> 0;
63
+ }
64
+ let a = hash[0];
65
+ let b = hash[1];
66
+ let c = hash[2];
67
+ let d = hash[3];
68
+ let e = hash[4];
69
+ let f = hash[5];
70
+ let g = hash[6];
71
+ let h = hash[7];
72
+ for (let index = 0; index < 64; index += 1) {
73
+ const sum1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
74
+ const choose = e & f ^ ~e & g;
75
+ const temporary1 = h + sum1 + choose + SHA256_CONSTANTS[index] + schedule[index] >>> 0;
76
+ const sum0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
77
+ const majority = a & b ^ a & c ^ b & c;
78
+ const temporary2 = sum0 + majority >>> 0;
79
+ h = g;
80
+ g = f;
81
+ f = e;
82
+ e = d + temporary1 >>> 0;
83
+ d = c;
84
+ c = b;
85
+ b = a;
86
+ a = temporary1 + temporary2 >>> 0;
87
+ }
88
+ hash[0] = hash[0] + a >>> 0;
89
+ hash[1] = hash[1] + b >>> 0;
90
+ hash[2] = hash[2] + c >>> 0;
91
+ hash[3] = hash[3] + d >>> 0;
92
+ hash[4] = hash[4] + e >>> 0;
93
+ hash[5] = hash[5] + f >>> 0;
94
+ hash[6] = hash[6] + g >>> 0;
95
+ hash[7] = hash[7] + h >>> 0;
96
+ }
97
+ return Array.from(hash, word => word.toString(16).padStart(8, "0")).join("");
98
+ }
99
+
100
+ /**
101
+ * Browser-safe synchronous SHA-256 for a UTF-8 string.
102
+ *
103
+ * @param {string} text UTF-16 JavaScript string encoded as UTF-8.
104
+ * @returns {string} Lower-case hexadecimal digest.
105
+ */
106
+ function sha256Utf8(text) {
107
+ if (typeof text !== "string") {
108
+ throw new TypeError("SHA-256 input must be a string");
109
+ }
110
+ return sha256Bytes(new TextEncoder().encode(text));
111
+ }
112
+
113
+ export { sha256Bytes, sha256Utf8 };
114
+ //# sourceMappingURL=sha256.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.js","sources":["../../../../src/format/effect/sha256.js"],"sourcesContent":["const SHA256_CONSTANTS = Object.freeze([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/**\n * Rotate one unsigned 32-bit word right.\n *\n * @param {number} value Unsigned word.\n * @param {number} shift Bit count.\n * @returns {number} Rotated word.\n */\nfunction rotateRight(value, shift)\n{\n return (value >>> shift) | (value << (32 - shift));\n}\n\n/**\n * Normalize an exact byte range without copying it.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Candidate byte range.\n * @returns {Uint8Array} Exact byte view.\n */\nfunction normalizeBytes(input)\n{\n if (input instanceof Uint8Array)\n {\n return input;\n }\n if (input instanceof ArrayBuffer)\n {\n return new Uint8Array(input);\n }\n if (ArrayBuffer.isView(input))\n {\n return new Uint8Array(input.buffer, input.byteOffset, input.byteLength);\n }\n throw new TypeError(\n \"SHA-256 input must be Uint8Array, ArrayBuffer, or ArrayBufferView bytes\"\n );\n}\n\n/**\n * Browser-safe synchronous SHA-256 over an exact byte view.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Bytes to hash.\n * @returns {string} Lower-case hexadecimal digest.\n */\nexport function sha256Bytes(input)\n{\n const inputBytes = normalizeBytes(input);\n const paddedLength = Math.ceil((inputBytes.length + 9) / 64) * 64;\n const bytes = new Uint8Array(paddedLength);\n bytes.set(inputBytes);\n bytes[inputBytes.length] = 0x80;\n let bitLength = BigInt(inputBytes.length) * 8n;\n for (let index = 0; index < 8; index += 1)\n {\n bytes[paddedLength - 1 - index] = Number(bitLength & 0xffn);\n bitLength >>= 8n;\n }\n const hash = new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ]);\n const schedule = new Uint32Array(64);\n for (let offset = 0; offset < bytes.length; offset += 64)\n {\n for (let index = 0; index < 16; index += 1)\n {\n const word = offset + index * 4;\n schedule[index] = (\n bytes[word] * 0x1000000\n + bytes[word + 1] * 0x10000\n + bytes[word + 2] * 0x100\n + bytes[word + 3]\n ) >>> 0;\n }\n for (let index = 16; index < 64; index += 1)\n {\n const left = schedule[index - 15];\n const right = schedule[index - 2];\n const sigma0 = rotateRight(left, 7)\n ^ rotateRight(left, 18) ^ (left >>> 3);\n const sigma1 = rotateRight(right, 17)\n ^ rotateRight(right, 19) ^ (right >>> 10);\n schedule[index] = (\n schedule[index - 16] + sigma0\n + schedule[index - 7] + sigma1\n ) >>> 0;\n }\n let a = hash[0];\n let b = hash[1];\n let c = hash[2];\n let d = hash[3];\n let e = hash[4];\n let f = hash[5];\n let g = hash[6];\n let h = hash[7];\n for (let index = 0; index < 64; index += 1)\n {\n const sum1 = rotateRight(e, 6)\n ^ rotateRight(e, 11) ^ rotateRight(e, 25);\n const choose = (e & f) ^ (~e & g);\n const temporary1 = (\n h + sum1 + choose\n + SHA256_CONSTANTS[index] + schedule[index]\n ) >>> 0;\n const sum0 = rotateRight(a, 2)\n ^ rotateRight(a, 13) ^ rotateRight(a, 22);\n const majority = (a & b) ^ (a & c) ^ (b & c);\n const temporary2 = (sum0 + majority) >>> 0;\n h = g;\n g = f;\n f = e;\n e = (d + temporary1) >>> 0;\n d = c;\n c = b;\n b = a;\n a = (temporary1 + temporary2) >>> 0;\n }\n hash[0] = (hash[0] + a) >>> 0;\n hash[1] = (hash[1] + b) >>> 0;\n hash[2] = (hash[2] + c) >>> 0;\n hash[3] = (hash[3] + d) >>> 0;\n hash[4] = (hash[4] + e) >>> 0;\n hash[5] = (hash[5] + f) >>> 0;\n hash[6] = (hash[6] + g) >>> 0;\n hash[7] = (hash[7] + h) >>> 0;\n }\n return Array.from(hash, (word) =>\n word.toString(16).padStart(8, \"0\")).join(\"\");\n}\n\n/**\n * Browser-safe synchronous SHA-256 for a UTF-8 string.\n *\n * @param {string} text UTF-16 JavaScript string encoded as UTF-8.\n * @returns {string} Lower-case hexadecimal digest.\n */\nexport function sha256Utf8(text)\n{\n if (typeof text !== \"string\")\n {\n throw new TypeError(\"SHA-256 input must be a string\");\n }\n return sha256Bytes(new TextEncoder().encode(text));\n}\n"],"names":["SHA256_CONSTANTS","Object","freeze","rotateRight","value","shift","normalizeBytes","input","Uint8Array","ArrayBuffer","isView","buffer","byteOffset","byteLength","TypeError","sha256Bytes","inputBytes","paddedLength","Math","ceil","length","bytes","set","bitLength","BigInt","index","Number","hash","Uint32Array","schedule","offset","word","left","right","sigma0","sigma1","a","b","c","d","e","f","g","h","sum1","choose","temporary1","sum0","majority","temporary2","Array","from","toString","padStart","join","sha256Utf8","text","TextEncoder","encode"],"mappings":"AAAA,MAAMA,gBAAgB,GAAGC,MAAM,CAACC,MAAM,CAAC,CACnC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU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CAAC,CAAC,GAAIA,IAAI,CAAC,CAAC,CAAC,GAAGa,CAAC,KAAM,CAAC;IAC7Bb,IAAI,CAAC,CAAC,CAAC,GAAIA,IAAI,CAAC,CAAC,CAAC,GAAGc,CAAC,KAAM,CAAC;IAC7Bd,IAAI,CAAC,CAAC,CAAC,GAAIA,IAAI,CAAC,CAAC,CAAC,GAAGe,CAAC,KAAM,CAAC;IAC7Bf,IAAI,CAAC,CAAC,CAAC,GAAIA,IAAI,CAAC,CAAC,CAAC,GAAGgB,CAAC,KAAM,CAAC;AACjC,EAAA;EACA,OAAOO,KAAK,CAACC,IAAI,CAACxB,IAAI,EAAGI,IAAI,IACzBA,IAAI,CAACqB,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,IAAI,EAC/B;AACI,EAAA,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAC5B;AACI,IAAA,MAAM,IAAI1C,SAAS,CAAC,gCAAgC,CAAC;AACzD,EAAA;EACA,OAAOC,WAAW,CAAC,IAAI0C,WAAW,EAAE,CAACC,MAAM,CAACF,IAAI,CAAC,CAAC;AACtD;;;;"}
@@ -0,0 +1,142 @@
1
+ import { DxbcContainer } from './core/container.js';
2
+ import { DEFAULT_VALUES, normalizeValues, readWithValues, inspectWithValues, toJsonValue, OUTPUT_JSON, OUTPUT_RAW } from './core/helpers.js';
3
+
4
+ /**
5
+ * Exposed CarbonEngineJS-facing DXBC format class.
6
+ *
7
+ * Keep this file small and reviewable: container/signature/program parsing
8
+ * and the instruction decoder live in core/; input/option normalization and
9
+ * the shared read path live in core/helpers.js.
10
+ */
11
+
12
+ const FORMAT_NAME = "CjsDxbcFormat";
13
+
14
+ /**
15
+ * CarbonEngineJS-facing DXBC (Direct3D shader bytecode) reader.
16
+ *
17
+ * The Cjs prefix marks this as a JavaScript format/construction boundary.
18
+ * DXBC is Microsoft's compiled-shader container format; this reader has no
19
+ * CCP/Carbon vocabulary. It parses the container, signatures and the
20
+ * SM4/SM5 token stream, and emits plain JSON data by default or the raw
21
+ * decoder objects for backends (GLSL/WGSL emitters) that want them.
22
+ */
23
+ class CjsDxbcFormat {
24
+ #emit = DEFAULT_VALUES.emit;
25
+ #source = DEFAULT_VALUES.source;
26
+ #decodeInstructions = DEFAULT_VALUES.decodeInstructions;
27
+
28
+ /**
29
+ * Create a reusable format profile.
30
+ *
31
+ * @param {object} [options] Default format values.
32
+ */
33
+ constructor(options = {}) {
34
+ this.SetValues(options);
35
+ }
36
+
37
+ /**
38
+ * Set format values for this reusable profile.
39
+ *
40
+ * @param {object} [options] Values to merge into the profile.
41
+ * @returns {CjsDxbcFormat} This format profile.
42
+ */
43
+ SetValues(options = {}) {
44
+ const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);
45
+ this.#emit = values.emit;
46
+ this.#source = values.source;
47
+ this.#decodeInstructions = values.decodeInstructions;
48
+ return this;
49
+ }
50
+
51
+ /**
52
+ * Get this profile's current values, optionally with per-call overrides.
53
+ *
54
+ * @param {object} [options] Optional values to merge into a copy.
55
+ * @returns {object} A copy of the effective values.
56
+ */
57
+ GetValues(options = {}) {
58
+ return normalizeValues({
59
+ emit: this.#emit,
60
+ source: this.#source,
61
+ decodeInstructions: this.#decodeInstructions
62
+ }, options, FORMAT_NAME);
63
+ }
64
+
65
+ /**
66
+ * Read a DXBC payload with this profile's values.
67
+ *
68
+ * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC bytes.
69
+ * @param {object} [options] Per-call value overrides.
70
+ * @returns {object} Plain JSON data, or raw decoder objects when emit is "raw".
71
+ */
72
+ Read(input, options = {}) {
73
+ return readWithValues(input, this.GetValues(options));
74
+ }
75
+
76
+ /**
77
+ * Inspect a DXBC payload without decoding instructions.
78
+ *
79
+ * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC bytes.
80
+ * @param {object} [options] Per-call value overrides.
81
+ * @returns {object} Plain summary data.
82
+ */
83
+ Inspect(input, options = {}) {
84
+ return inspectWithValues(input, this.GetValues(options));
85
+ }
86
+
87
+ /**
88
+ * Static payload sniff. Static methods use camelCase by convention.
89
+ *
90
+ * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.
91
+ * @returns {boolean} True when the payload starts with the DXBC magic.
92
+ */
93
+ static isDxbc(input) {
94
+ try {
95
+ return DxbcContainer.IsDxbc(input);
96
+ } catch {
97
+ return false;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Static one-shot read.
103
+ *
104
+ * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC bytes.
105
+ * @param {object} [options] Format values.
106
+ * @returns {object} Plain JSON data, or raw decoder objects when emit is "raw".
107
+ */
108
+ static read(input, options = {}) {
109
+ return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));
110
+ }
111
+
112
+ /**
113
+ * Static one-shot inspection.
114
+ *
115
+ * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC bytes.
116
+ * @param {object} [options] Format values.
117
+ * @returns {object} Plain summary data.
118
+ */
119
+ static inspect(input, options = {}) {
120
+ return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));
121
+ }
122
+
123
+ /**
124
+ * Static JSON-compatible conversion.
125
+ *
126
+ * @param {any} value Format output to convert.
127
+ * @returns {any} Plain JSON-compatible data.
128
+ */
129
+ static toJSON(value) {
130
+ return toJsonValue(value);
131
+ }
132
+ static OUTPUT_JSON = OUTPUT_JSON;
133
+ static OUTPUT_RAW = OUTPUT_RAW;
134
+ static type = Object.freeze(["shader"]);
135
+ static mediaTypes = Object.freeze(["shader"]);
136
+ static inputTypes = Object.freeze(["dxbc"]);
137
+ static outputTypes = Object.freeze([OUTPUT_JSON]);
138
+ static debugOutputTypes = Object.freeze([OUTPUT_RAW]);
139
+ }
140
+
141
+ export { CjsDxbcFormat, CjsDxbcFormat as default };
142
+ //# sourceMappingURL=CjsDxbcFormat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CjsDxbcFormat.js","sources":["../../../../src/formats/dxbc/CjsDxbcFormat.js"],"sourcesContent":["/**\n * Exposed CarbonEngineJS-facing DXBC format class.\n *\n * Keep this file small and reviewable: container/signature/program parsing\n * and the instruction decoder live in core/; input/option normalization and\n * the shared read path live in core/helpers.js.\n */\n\nimport { DxbcContainer } from \"./core/container.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n OUTPUT_RAW,\n inspectWithValues,\n normalizeValues,\n readWithValues,\n toJsonValue\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsDxbcFormat\";\n\n/**\n * CarbonEngineJS-facing DXBC (Direct3D shader bytecode) reader.\n *\n * The Cjs prefix marks this as a JavaScript format/construction boundary.\n * DXBC is Microsoft's compiled-shader container format; this reader has no\n * CCP/Carbon vocabulary. It parses the container, signatures and the\n * SM4/SM5 token stream, and emits plain JSON data by default or the raw\n * decoder objects for backends (GLSL/WGSL emitters) that want them.\n */\nexport class CjsDxbcFormat\n{\n\n #emit = DEFAULT_VALUES.emit;\n #source = DEFAULT_VALUES.source;\n #decodeInstructions = DEFAULT_VALUES.decodeInstructions;\n\n /**\n * Create a reusable format profile.\n *\n * @param {object} [options] Default format values.\n */\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n /**\n * Set format values for this reusable profile.\n *\n * @param {object} [options] Values to merge into the profile.\n * @returns {CjsDxbcFormat} This format profile.\n */\n SetValues(options = {})\n {\n const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);\n\n this.#emit = values.emit;\n this.#source = values.source;\n this.#decodeInstructions = values.decodeInstructions;\n\n return this;\n }\n\n /**\n * Get this profile's current values, optionally with per-call overrides.\n *\n * @param {object} [options] Optional values to merge into a copy.\n * @returns {object} A copy of the effective values.\n */\n GetValues(options = {})\n {\n return normalizeValues({\n emit: this.#emit,\n source: this.#source,\n decodeInstructions: this.#decodeInstructions\n }, options, FORMAT_NAME);\n }\n\n /**\n * Read a DXBC payload with this profile's values.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Plain JSON data, or raw decoder objects when emit is \"raw\".\n */\n Read(input, options = {})\n {\n return readWithValues(input, this.GetValues(options));\n }\n\n /**\n * Inspect a DXBC payload without decoding instructions.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Plain summary data.\n */\n Inspect(input, options = {})\n {\n return inspectWithValues(input, this.GetValues(options));\n }\n\n /**\n * Static payload sniff. Static methods use camelCase by convention.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\n * @returns {boolean} True when the payload starts with the DXBC magic.\n */\n static isDxbc(input)\n {\n try\n {\n return DxbcContainer.IsDxbc(input);\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Static one-shot read.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC bytes.\n * @param {object} [options] Format values.\n * @returns {object} Plain JSON data, or raw decoder objects when emit is \"raw\".\n */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot inspection.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC bytes.\n * @param {object} [options] Format values.\n * @returns {object} Plain summary data.\n */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n static OUTPUT_JSON = OUTPUT_JSON;\n static OUTPUT_RAW = OUTPUT_RAW;\n static type = Object.freeze([ \"shader\" ]);\n static mediaTypes = Object.freeze([ \"shader\" ]);\n static inputTypes = Object.freeze([ \"dxbc\" ]);\n static outputTypes = Object.freeze([ OUTPUT_JSON ]);\n static debugOutputTypes = Object.freeze([ OUTPUT_RAW ]);\n\n}\n\nexport default CjsDxbcFormat;\n"],"names":["FORMAT_NAME","CjsDxbcFormat","DEFAULT_VALUES","emit","source","decodeInstructions","constructor","options","SetValues","values","normalizeValues","GetValues","Read","input","readWithValues","Inspect","inspectWithValues","isDxbc","DxbcContainer","IsDxbc","read","inspect","toJSON","value","toJsonValue","OUTPUT_JSON","OUTPUT_RAW","type","Object","freeze","mediaTypes","inputTypes","outputTypes","debugOutputTypes"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,MAAMA,WAAW,GAAG,eAAe;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,CAC1B;AAEI,EAAA,KAAK,GAAGC,cAAc,CAACC,IAAI;AAC3B,EAAA,OAAO,GAAGD,cAAc,CAACE,MAAM;AAC/B,EAAA,mBAAmB,GAAGF,cAAc,CAACG,kBAAkB;;AAEvD;AACJ;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,MAAME,MAAM,GAAGC,eAAe,CAAC,IAAI,CAACC,SAAS,EAAE,EAAEJ,OAAO,EAAEP,WAAW,CAAC;AAEtE,IAAA,IAAI,CAAC,KAAK,GAAGS,MAAM,CAACN,IAAI;AACxB,IAAA,IAAI,CAAC,OAAO,GAAGM,MAAM,CAACL,MAAM;AAC5B,IAAA,IAAI,CAAC,mBAAmB,GAAGK,MAAM,CAACJ,kBAAkB;AAEpD,IAAA,OAAO,IAAI;AACf,EAAA;;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