@carbonenginejs/runtime-resource 0.12.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/README.md +21 -0
  2. package/dist/CjsResMan.js +393 -29
  3. package/dist/CjsResMan.js.map +1 -1
  4. package/dist/format/carbonEffect/CjsCarbonEffectReader.js +165 -118
  5. package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
  6. package/dist/format/carbonEffect/buildCarbonEffectContainer.js +182 -0
  7. package/dist/format/carbonEffect/buildCarbonEffectContainer.js.map +1 -0
  8. package/dist/format/carbonEffect/carbonEffectBackendBlock.js +7 -113
  9. package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
  10. package/dist/format/carbonEffect/carbonEffectRecords.js +258 -66
  11. package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -1
  12. package/dist/format/carbonEffect/carbonEffectResourceTransform.js +197 -0
  13. package/dist/format/carbonEffect/carbonEffectResourceTransform.js.map +1 -0
  14. package/dist/format/effect/effectBodyInventory.js +146 -0
  15. package/dist/format/effect/effectBodyInventory.js.map +1 -0
  16. package/dist/format/effect/effectPermutationGraph.js +13 -13
  17. package/dist/format/effect/effectPermutationGraph.js.map +1 -1
  18. package/dist/format/index.js +4 -4
  19. package/dist/formats/black/CjsBlackFormat.js +19 -1
  20. package/dist/formats/black/CjsBlackFormat.js.map +1 -1
  21. package/dist/formats/bnk/CjsBnkFormat.js +28 -9
  22. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
  23. package/dist/formats/bnk/core/busNodes.js +252 -0
  24. package/dist/formats/bnk/core/busNodes.js.map +1 -0
  25. package/dist/formats/bnk/core/effectNodes.js +147 -0
  26. package/dist/formats/bnk/core/effectNodes.js.map +1 -0
  27. package/dist/formats/bnk/core/eventAction.js +135 -24
  28. package/dist/formats/bnk/core/eventAction.js.map +1 -1
  29. package/dist/formats/bnk/core/globalSettings.js +215 -0
  30. package/dist/formats/bnk/core/globalSettings.js.map +1 -0
  31. package/dist/formats/bnk/core/helpers.js +37 -5
  32. package/dist/formats/bnk/core/helpers.js.map +1 -1
  33. package/dist/formats/bnk/core/musicNodes.js +43 -19
  34. package/dist/formats/bnk/core/musicNodes.js.map +1 -1
  35. package/dist/formats/bnk/core/nodeBase.js +28 -7
  36. package/dist/formats/bnk/core/nodeBase.js.map +1 -1
  37. package/dist/formats/dds/core/helpers.js +40 -1
  38. package/dist/formats/dds/core/helpers.js.map +1 -1
  39. package/dist/formats/dxbc/CjsDxbcFormat.js +45 -0
  40. package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  41. package/dist/formats/dxbc/core/disassemble.js +240 -0
  42. package/dist/formats/dxbc/core/disassemble.js.map +1 -0
  43. package/dist/formats/gltf/CjsGltfFormat.js +1 -39
  44. package/dist/formats/gltf/CjsGltfFormat.js.map +1 -1
  45. package/dist/formats/gltf/core/helpers.js +1 -21
  46. package/dist/formats/gltf/core/helpers.js.map +1 -1
  47. package/dist/formats/hlsl/CjsHlslFormat.js +0 -21
  48. package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -1
  49. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +118 -49
  50. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
  51. package/dist/formats/hlsl/core/detailMapFamily.js +128 -0
  52. package/dist/formats/hlsl/core/detailMapFamily.js.map +1 -0
  53. package/dist/formats/hlsl/core/localLightFamily.js +133 -0
  54. package/dist/formats/hlsl/core/localLightFamily.js.map +1 -0
  55. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +79 -73
  56. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
  57. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +8 -1
  58. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js.map +1 -1
  59. package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js +11 -691
  60. package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js.map +1 -1
  61. package/dist/formats/index.js +4 -2
  62. package/dist/formats/index.js.map +1 -1
  63. package/dist/formats/obj/CjsObjFormat.js +1 -22
  64. package/dist/formats/obj/CjsObjFormat.js.map +1 -1
  65. package/dist/formats/obj/core/helpers.js +1 -21
  66. package/dist/formats/obj/core/helpers.js.map +1 -1
  67. package/dist/formats/pickle/CjsPickleFormat.js +214 -0
  68. package/dist/formats/pickle/CjsPickleFormat.js.map +1 -0
  69. package/dist/formats/pickle/core/CjsPickleProtocol0Reader.js +551 -0
  70. package/dist/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -0
  71. package/dist/formats/pickle/index.js +2 -0
  72. package/dist/formats/pickle/index.js.map +1 -0
  73. package/dist/formats/red/core/redGraph.js +11 -8
  74. package/dist/formats/red/core/redGraph.js.map +1 -1
  75. package/dist/formats/stl/CjsStlFormat.js +1 -46
  76. package/dist/formats/stl/CjsStlFormat.js.map +1 -1
  77. package/dist/formats/stl/core/helpers.js +1 -21
  78. package/dist/formats/stl/core/helpers.js.map +1 -1
  79. package/dist/formats/webgl/CjsWebglFormat.js +33 -55
  80. package/dist/formats/webgl/CjsWebglFormat.js.map +1 -1
  81. package/dist/formats/webgl/core/buildGlslEffectContainer.js +70 -0
  82. package/dist/formats/webgl/core/buildGlslEffectContainer.js.map +1 -0
  83. package/dist/formats/webgl/core/effectPackage.js +216 -108
  84. package/dist/formats/webgl/core/effectPackage.js.map +1 -1
  85. package/dist/formats/webgl/core/errors.js +1 -1
  86. package/dist/formats/webgl/core/errors.js.map +1 -1
  87. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +166 -24
  88. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  89. package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +63 -5
  90. package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
  91. package/dist/formats/webgl/core/glsl/packedLightFixups.js +98 -0
  92. package/dist/formats/webgl/core/glsl/packedLightFixups.js.map +1 -0
  93. package/dist/formats/webgl/core/glslBackendBlock.js +552 -0
  94. package/dist/formats/webgl/core/glslBackendBlock.js.map +1 -0
  95. package/dist/formats/webgl/core/glslBackendBodySet.js +243 -0
  96. package/dist/formats/webgl/core/glslBackendBodySet.js.map +1 -0
  97. package/dist/formats/webgl/core/{cewgCompleteness.js → glslEffectCompleteness.js} +12 -8
  98. package/dist/formats/webgl/core/glslEffectCompleteness.js.map +1 -0
  99. package/dist/formats/webgl/core/helpers.js +33 -172
  100. package/dist/formats/webgl/core/helpers.js.map +1 -1
  101. package/dist/formats/webgl/core/inspectGlslEffectContainer.js +122 -0
  102. package/dist/formats/webgl/core/inspectGlslEffectContainer.js.map +1 -0
  103. package/dist/formats/webgl/core/readGlslEffectContainer.js +249 -0
  104. package/dist/formats/webgl/core/readGlslEffectContainer.js.map +1 -0
  105. package/dist/formats/webgpu/CjsWebgpuFormat.js +15 -15
  106. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  107. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +37 -145
  108. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -1
  109. package/dist/formats/webgpu/core/{cewgpu/CewgpuContainer.js → carbonWebgpu/CarbonWebgpuContainer.js} +13 -27
  110. package/dist/formats/webgpu/core/carbonWebgpu/CarbonWebgpuContainer.js.map +1 -0
  111. package/dist/formats/webgpu/core/{cewgpu → carbonWebgpu}/containerViews.js +1 -1
  112. package/dist/formats/webgpu/core/carbonWebgpu/containerViews.js.map +1 -0
  113. package/dist/formats/webgpu/core/{cewgpu → carbonWebgpu}/validateContainer.js +4 -4
  114. package/dist/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -0
  115. package/dist/formats/webgpu/core/effectBackendBodySet.js +18 -18
  116. package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
  117. package/dist/formats/webgpu/core/errors.js +1 -1
  118. package/dist/formats/webgpu/core/errors.js.map +1 -1
  119. package/dist/formats/webgpu/core/helpers.js +22 -22
  120. package/dist/formats/webgpu/core/helpers.js.map +1 -1
  121. package/dist/formats/webgpu/core/packageEffect.js +11 -15
  122. package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
  123. package/dist/formats/webgpu/core/packageEffectSelection.js +1 -1
  124. package/dist/formats/webgpu/core/packageEffectSelection.js.map +1 -1
  125. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +23 -23
  126. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
  127. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +6 -6
  128. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
  129. package/dist/formats/yaml/CjsYamlFormat.js +3 -3
  130. package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
  131. package/dist/formats/yaml/core/CjsYamlReader.js +4 -6
  132. package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
  133. package/dist/formats/yaml/core/helpers.js +27 -1
  134. package/dist/formats/yaml/core/helpers.js.map +1 -1
  135. package/dist/index.js +2 -0
  136. package/dist/index.js.map +1 -1
  137. package/dist/resource/CjsLoadingObject.js +19 -0
  138. package/dist/resource/CjsLoadingObject.js.map +1 -0
  139. package/dist/resource/CjsResource.js +4 -0
  140. package/dist/resource/CjsResource.js.map +1 -1
  141. package/dist/resource/ResourceHandlerMode.js +14 -0
  142. package/dist/resource/ResourceHandlerMode.js.map +1 -0
  143. package/dist/resource/index.js +2 -0
  144. package/dist/resource/index.js.map +1 -1
  145. package/dist/resource/shader/Tr2EffectRes.js +118 -213
  146. package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
  147. package/dist/resource/shader/Tr2Shader.js +37 -15
  148. package/dist/resource/shader/Tr2Shader.js.map +1 -1
  149. package/dist/resource/shader/reflection/Tr2EffectConstant.js +37 -29
  150. package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
  151. package/dist/resource/shader/reflection/Tr2EffectDescription.js +39 -34
  152. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
  153. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +51 -30
  154. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
  155. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +45 -25
  156. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
  157. package/dist/resource/shader/reflection/Tr2EffectResource.js +51 -17
  158. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  159. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +219 -88
  160. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
  161. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +28 -18
  162. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
  163. package/dist/resource/shader/reflection/Tr2Pass.js +96 -39
  164. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  165. package/dist/resource/shader/reflection/carbonRecordFields.js +159 -0
  166. package/dist/resource/shader/reflection/carbonRecordFields.js.map +1 -0
  167. package/dist/resource/shader/reflection/shaderStage.js +22 -0
  168. package/dist/resource/shader/reflection/shaderStage.js.map +1 -0
  169. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +68 -10
  170. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
  171. package/dist/worker/CjsResManMainThreadLoader.js +9 -7
  172. package/dist/worker/CjsResManMainThreadLoader.js.map +1 -1
  173. package/dist/worker/CjsResManWorker.js +5 -4
  174. package/dist/worker/CjsResManWorker.js.map +1 -1
  175. package/dist/worker/CjsResManWorkerLoader.js +9 -6
  176. package/dist/worker/CjsResManWorkerLoader.js.map +1 -1
  177. package/docs/README.md +2 -2
  178. package/docs/architecture.md +12 -3
  179. package/docs/concepts/resource-lifecycle.md +9 -8
  180. package/docs/concepts/shader-resource-model.md +14 -17
  181. package/docs/concepts/writing-an-engine-adapter.md +1 -1
  182. package/docs/formats/README.md +4 -2
  183. package/docs/formats/carbon-effect-container.md +127 -26
  184. package/docs/formats/dxbc/architecture.md +1 -1
  185. package/docs/formats/dxbc/reference/api.md +28 -0
  186. package/docs/formats/hlsl/README.md +3 -3
  187. package/docs/formats/hlsl/architecture.md +8 -9
  188. package/docs/formats/hlsl/guides/hydrating-json-output.md +3 -5
  189. package/docs/formats/hlsl/guides/reading-effects.md +5 -1
  190. package/docs/formats/hlsl/reference/advanced-analysis.md +20 -25
  191. package/docs/formats/hlsl/reference/api.md +0 -7
  192. package/docs/formats/hlsl/reference/json-graph.md +1 -4
  193. package/docs/formats/pickle.md +82 -0
  194. package/docs/formats/webgl/README.md +71 -13
  195. package/docs/formats/webgl/architecture.md +16 -17
  196. package/docs/formats/webgl/carbon-constant-layouts.md +3 -3
  197. package/docs/formats/webgl/decl-io.md +3 -3
  198. package/docs/formats/webgl/memory-structured.md +27 -8
  199. package/docs/formats/webgl/texture-sample.md +1 -1
  200. package/docs/formats/webgpu/README.md +3 -3
  201. package/docs/formats/webgpu/architecture.md +5 -6
  202. package/docs/formats/webgpu/formats/{cewgpu.md → carbon-webgpu.md} +10 -11
  203. package/docs/formats/webgpu/guides/effect-packaging.md +6 -8
  204. package/docs/formats/webgpu/reference/api.md +11 -12
  205. package/docs/formats/webgpu/reference/wgsl-compatibility.md +11 -8
  206. package/docs/formats/wwise.md +63 -2
  207. package/docs/reference/classes/core.md +10 -0
  208. package/docs/reference/classes/formats.md +40 -48
  209. package/docs/reference/classes/resources.md +2 -2
  210. package/docs/reference/queues.md +88 -4
  211. package/docs/reference/workers.md +7 -0
  212. package/package.json +61 -61
  213. package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +0 -372
  214. package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +0 -1
  215. package/dist/format/effect/effectReflectionPackage.js +0 -636
  216. package/dist/format/effect/effectReflectionPackage.js.map +0 -1
  217. package/dist/formats/hlsl/core/HlslReader.js +0 -16
  218. package/dist/formats/hlsl/core/HlslReader.js.map +0 -1
  219. package/dist/formats/hlsl/core/portableReflection.js +0 -848
  220. package/dist/formats/hlsl/core/portableReflection.js.map +0 -1
  221. package/dist/formats/hlsl/portable.js +0 -2
  222. package/dist/formats/hlsl/portable.js.map +0 -1
  223. package/dist/formats/webgl/core/cewg/CewgPackage.js +0 -340
  224. package/dist/formats/webgl/core/cewg/CewgPackage.js.map +0 -1
  225. package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js +0 -104
  226. package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js.map +0 -1
  227. package/dist/formats/webgl/core/cewg/binary.js +0 -19
  228. package/dist/formats/webgl/core/cewg/binary.js.map +0 -1
  229. package/dist/formats/webgl/core/cewgCompleteness.js.map +0 -1
  230. package/dist/formats/webgl/core/effectPackageValidation.js +0 -331
  231. package/dist/formats/webgl/core/effectPackageValidation.js.map +0 -1
  232. package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +0 -1
  233. package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +0 -1
  234. package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +0 -1
  235. package/dist/resource/shader/portable.js +0 -33
  236. package/dist/resource/shader/portable.js.map +0 -1
  237. package/docs/formats/hlsl/reference/portable-reflection.md +0 -141
  238. package/docs/formats/webgl/effect-reflection.md +0 -127
@@ -3,40 +3,98 @@
3
3
  Status: Evolving
4
4
  Scope: `@carbonenginejs/runtime-resource/formats/webgl`
5
5
  Audience: Shader-tool authors, runtime integrators, and maintainers
6
- Summary: Explains CEWG packages, portable reflection, and DXBC-to-GLSL conversion.
6
+ Summary: Explains WebGL effect packages, completeness, and DXBC-to-GLSL conversion.
7
7
 
8
8
  ## Purpose
9
9
 
10
- `@carbonenginejs/runtime-resource/formats/webgl` reads and builds CEWG packages and converts
11
- supported compiled Carbon effect stages into GLSL ES 3.00 package data. It
12
- preserves complete source permutation topology and, for version-15 effects,
13
- portable reflection for every unique body without creating live shader or GPU
14
- objects.
10
+ `@carbonenginejs/runtime-resource/formats/webgl` builds effect packages and
11
+ converts supported compiled Carbon effect stages into GLSL ES 3.00 package
12
+ data. It preserves complete source permutation topology without creating live
13
+ shader or GPU objects.
15
14
 
16
15
  ## Use this package when
17
16
 
18
- Use `format-webgl` to inspect or build CEWG bytes, translate supported DXBC
17
+ Use `format-webgl` to inspect or build package bytes, translate supported DXBC
19
18
  stages, or convert one compiled effect while preserving all source
20
- permutations and portable reflection. Use runtime and engine packages for live
21
- shader objects, resource selection, bindings, and draws.
19
+ permutations. Use runtime and engine packages for live shader objects, resource
20
+ selection, bindings, and draws.
22
21
 
23
22
  ## Where it fits
24
23
 
25
24
  ```text
26
25
  compiled effect bytes
27
26
  |
28
- +---- format-hlsl ---- portable source reflection
27
+ +---- format-hlsl ---- source parsing and permutation analysis
29
28
  +---- format-dxbc ---- decoded shader programs
30
29
  |
31
30
  v
32
31
  format-webgl
33
- CEWG + GLSL ES 3.00
32
+ Carbon container + GLSL ES 3.00
34
33
  |
35
- +---- runtime-resource ---- selection, cache, Tr2Shader hydration
34
+ +---- runtime-resource ---- selection, cache, Tr2Shader
36
35
  +---- runtime-trinity ----- effect/material facade and parameters
37
36
  `---- WebGL engine -------- programs, bindings, and draws
38
37
  ```
39
38
 
39
+ The emitted artifact is a shared Carbon v15 container, not a tagged-chunk
40
+ package; the GLSL replaces the DXBC in each stage's program slot. Backend body
41
+ keys deliberately retain the historical `body_<offset>_<size>` form.
42
+ `EFFECT_PERMUTATION_GRAPH_CHUNK` (`PGRF`) still records every Cartesian
43
+ permutation, its option indices, its exact source record, and a
44
+ content-deduplicated body identity.
45
+
46
+ ## Completeness
47
+
48
+ The build result reports four flags plus a separate qualification:
49
+
50
+ - `sourceComplete` is true only for version-15 effects.
51
+ - `backendComplete` remains false. Successful translation does not yet prove
52
+ the engine's physical binding/layout and transform contract.
53
+ - `runtimeComplete` remains false. Live shader objects and GPU handles are
54
+ outside the format package.
55
+ - `qualification.ok` separately reports whether the selected WebGL programs
56
+ translated and formed the required raster/compute families. It is returned
57
+ frozen.
58
+
59
+ Selected-only or technique/pass/stage-filtered packages still carry complete
60
+ version-15 source coverage, but only their selected backend programs.
61
+
62
+ Beyond those flags, `glslEffectCompleteness` runs checks that a translation can
63
+ be structurally valid and still be wrong. Two families are worth knowing about:
64
+
65
+ - `unlowered_local_light_family` — the recognised local-light constants
66
+ survived into GLSL without being lowered. It is deliberately scoped to that
67
+ one family: a general "every declared resource is used" rule fires on good
68
+ builds, because Carbon routinely describes resources a body does not read.
69
+ - `resource_transform_underfilled`, `_layer_gap`, `_carrier_undeclared`, and
70
+ `_input_still_bound` — a declared resource transform (the detail-map array is
71
+ the live case) did not complete. Each check is scoped to the stage the
72
+ transform names, and transform vocabulary is WGSL's: a transform saying
73
+ `fragment` applies to the WebGL `pixel` stage. Running them across every
74
+ stage in a pass instead produces 48 false positives.
75
+
76
+ ### Measured link rate
77
+
78
+ Across all 4,833 shipped compiled effects, **9,319 of 9,321 emitted programs
79
+ compile and link in a real WebGL2 context.** Before the DXBC SM5.1 range-id
80
+ operand fix the rate was near 61%, and the failures were the lesser half of the
81
+ problem: shaders that *did* link were reading constant-buffer rows off the
82
+ register number, and in 56 of 161 multi-dimensional resource operands were
83
+ bound to the wrong texture entirely.
84
+
85
+ ## Tier and permutation policy
86
+
87
+ For EVE shader work:
88
+
89
+ - High is `.sm_depth`.
90
+ - Medium is `.sm_hi`.
91
+ - Low is `.sm_lo`.
92
+ - Unpacked Quad V5 evidence must explicitly select `SOPPT_ENABLED`; the
93
+ default permutation is commonly PPT-off and is not representative.
94
+
95
+ Always resolve an option tuple against the current source axes. Do not persist
96
+ a permutation index across builds.
97
+
40
98
  ## Start here
41
99
 
42
100
  ```js
@@ -49,7 +107,7 @@ const packageData = CjsWebglFormat.read(packageBytes);
49
107
  ## Documentation map
50
108
 
51
109
  - [Architecture and ownership](architecture.md)
52
- - [Effect reflection contract](effect-reflection.md)
110
+ - [Carbon compiled-effect container](../carbon-effect-container.md)
53
111
  - [Constant-buffer layouts](carbon-constant-layouts.md)
54
112
  - [Declaration and I/O lowering](decl-io.md)
55
113
  - [Structured-memory lowering](memory-structured.md)
@@ -8,37 +8,37 @@ Summary: Defines the package's compiler, container, runtime, and engine boundari
8
8
  ## Purpose
9
9
 
10
10
  `format-webgl` is the transformation and package layer between compiled
11
- Carbon-style effects and WebGL engine realization. It emits portable CEWG data
12
- and GLSL ES 3.00 without constructing mutable runtime shader classes or WebGL
13
- objects.
11
+ Carbon-style effects and WebGL engine realization. It emits Carbon container
12
+ bytes and GLSL ES 3.00 without constructing mutable runtime shader classes or
13
+ WebGL objects.
14
14
 
15
15
  ## Dependency direction
16
16
 
17
17
  ```text
18
18
  @carbonenginejs/runtime-resource/formats/hlsl
19
19
  |
20
- +---- effect parsing and portable reflection
20
+ +---- effect parsing and permutation analysis
21
21
  |
22
22
  v
23
23
  @carbonenginejs/runtime-resource/formats/webgl <---- @carbonenginejs/runtime-resource/formats/dxbc
24
24
  | decoded DXBC
25
25
  |
26
- +---- CEWG bytes, metadata, reflection, GLSL
26
+ +---- Carbon container bytes, metadata, GLSL
27
27
  |
28
- +---- runtime-resource ---- package selection + Tr2Shader hydration
28
+ +---- runtime-resource ---- option selection + Tr2Shader
29
29
  +---- runtime-trinity ----- effect/material facade + parameters
30
30
  `---- WebGL engine -------- GPU realization
31
31
  ```
32
32
 
33
33
  Tools may call the public byte-oriented API, but the format package does not
34
- import the toolchain. Runtime packages consume immutable package data through
35
- an explicit adapter boundary.
34
+ import the toolchain. Runtime packages read the emitted container bytes
35
+ directly.
36
36
 
37
37
  ## Owned responsibilities
38
38
 
39
- - Reading, inspecting, validating, and building CEWG v1 containers.
39
+ - Building the shared Carbon v15 container for the WebGL backend, with GLSL in
40
+ each stage's program slot.
40
41
  - Preserving every source permutation and unique body identity.
41
- - Packing complete version-15 portable reflection and exact shared bytes.
42
42
  - Translating supported DXBC vertex, pixel, and bounded map-style compute
43
43
  stages into GLSL ES 3.00.
44
44
  - Preserving backend bodies, stages, programs, manifests, and render states.
@@ -46,12 +46,11 @@ an explicit adapter boundary.
46
46
 
47
47
  ## Ownership elsewhere
48
48
 
49
- - `format-hlsl` owns compiled-effect parsing and the portable reflection
50
- schema.
49
+ - `format-hlsl` owns compiled-effect parsing and permutation analysis.
51
50
  - `format-dxbc` owns DXBC decoding.
52
- - `runtime-resource` owns `Tr2EffectRes`, package bytes, option selection,
53
- per-permutation cache identity, canonical `Tr2Shader`, reflection records,
54
- sampler setup records, and portable hydration.
51
+ - `runtime-resource` owns `Tr2EffectRes`, the container bytes, option
52
+ selection, per-permutation cache identity, canonical `Tr2Shader`, reflection
53
+ records, and sampler setup records.
55
54
  - `runtime-trinity` owns the mutable `Tr2Effect`/`Tr2Material` facade,
56
55
  parameters, authored options, and sampler overrides.
57
56
  - The WebGL engine owns program compilation, locations, layouts, resource
@@ -59,12 +58,12 @@ an explicit adapter boundary.
59
58
 
60
59
  ## Completeness boundary
61
60
 
62
- Version-15 CEWG can be source-complete while remaining backend- and
61
+ A version-15 build can be source-complete while remaining backend- and
63
62
  runtime-incomplete. Successful GLSL translation and compile/link do not prove
64
63
  the engine's physical binding/layout contract or a rendered result.
65
64
 
66
65
  ## Related documentation
67
66
 
68
67
  - [Package documentation](README.md)
69
- - [Effect reflection contract](effect-reflection.md)
68
+ - [Carbon compiled-effect container](../carbon-effect-container.md)
70
69
  - [Class-purpose catalog](reference/classes/README.md)
@@ -5,7 +5,7 @@ Scope: Carbon/Trinity constant-buffer layouts used by `@carbonenginejs/runtime-r
5
5
  Audience: Shader translators, runtime packers, and engine integrators
6
6
  Summary: Maps Carbon constant-buffer registers and field layouts for WebGL integration.
7
7
 
8
- > Produced 2026-07-05 from ../carbonengine source (authoritative) for the CEWG
8
+ > Produced 2026-07-05 from ../carbonengine source (authoritative) for the Carbon WebGL
9
9
  > per-frame/per-object packer in ccpwgl. All register offsets are in float4
10
10
  > (vec4) units. File references are relative to
11
11
  > `../carbonengine/trinity/trinity/`.
@@ -271,8 +271,8 @@ cascaded-shadow + froxel tail (95 regs) is absent in ccpwgl.
271
271
  In Carbon DX11, cb3[26]=boneOffsets, cb3[27]=morph, cb3[28]=customData, and
272
272
  joints live in the separate `BoneTransforms` structured buffer (69 max,
273
273
  Float4x3). ccpwgl WebGL2 splices 58 joints inline at cb3[26..199] instead.
274
- The CEWG path keeps Carbon's shape: cb3 stays 29 regs, joints go to the
275
- dedicated CewgSb UBO (capacity 69). Bone-count note: Carbon
274
+ The Carbon WebGL path keeps Carbon's shape: cb3 stays 29 regs, joints go to the
275
+ dedicated CjsSb UBO (capacity 69). Bone-count note: Carbon
276
276
  TR2_MAX_BONES_PER_MESHAREA=69 vs ccpwgl inline 58 (likely a WebGL uniform
277
277
  budget choice, not a Carbon constant).
278
278
 
@@ -543,7 +543,7 @@ target lowering is "emit nothing" — worth flagging clearly to the implementing
543
543
  engineer so they don't go looking for a `s0` GLSL symbol; the register-stable name
544
544
  `s0` only shows up in Carbon binding-manifest metadata (`CARBONENGINEJS-FORK.md`:
545
545
  "`s0`" is one of the register-stable symbols this fork preserves for
546
- `Tr2EffectBindingManifest`), not in the GLSL source text itself.
546
+ `HlslEffectBindingManifest`), not in the GLSL source text itself.
547
547
 
548
548
  **Confidence: high** — the Vulkan/non-Vulkan branch is unconditional and
549
549
  unambiguous; the only judgment call is confirming this project always wants
@@ -622,7 +622,7 @@ attribute channels, including blend indices, as float vertex attributes via
622
622
  `gl.vertexAttribPointer` (not `vertexAttribIPointer`)** — a real `uvec4 in_...`
623
623
  declaration either fails to link against that float-typed buffer binding, or links
624
624
  but silently produces garbage/invisible geometry
625
- (`028-cewg-skinned-blend-index-abi-lowering.md`: "Raw CEWG validation can link
625
+ (`028-cewg-skinned-blend-index-abi-lowering.md`: "Raw Carbon WebGL validation can link
626
626
  integer attributes, but ccpwgl runtime binding can still fail or produce invisible
627
627
  geometry if the source reaches compile as `uvec4`."). The proven, validated fix
628
628
  (`028-...md`; `TRANSPILING-GAPS.md` "Ranked helper action plan" documents the general
@@ -635,7 +635,7 @@ and bitcast at every *use* site instead: any instruction reading `in_BLENDINDICE
635
635
  as an index wraps it in `floatBitsToUint(in_BLENDINDICES0)` (or, if the actual buffer
636
636
  data was uploaded as plain float index values rather than bit-pattern-encoded uints —
637
637
  verify per-attribute — a plain `uint(in_BLENDINDICES0.x)` truncating conversion
638
- instead of a bitcast; the CEWG lowering evidence describes casting at use sites but
638
+ instead of a bitcast; the Carbon WebGL lowering evidence describes casting at use sites but
639
639
  does not pin down which of these two forms every producer used, see Confidence
640
640
  below). This is the **general form** of the family-level "every register is a float
641
641
  vec4" convention applied specifically to `dcl_input`: unlike the `r#` temp file
@@ -171,10 +171,18 @@ runnable WebGL2 GLSL for, restricted to the `BoneTransforms` skinning case
171
171
  byteOffset" agreement check, silently no-opping the rewrite. The previous
172
172
  worked example here was internally inconsistent with the very rewrite
173
173
  contract it was illustrating.
174
- 2. A package-time rewrite pass (`scripts/packageTr2WebglEffect.js`,
175
- functions `lowerWebgl2SkinningAbi` at lines 826-864 and
176
- `lowerStructuredBoneLoad` at lines 873-902) runs over that generated GLSL text
177
- and performs, **in this exact order**:
174
+ 2. A package-time rewrite pass over the generated GLSL text, performing the
175
+ steps below **in this exact order**.
176
+
177
+ > **Superseded (2026-08-02).** This pass no longer exists. The emitter now
178
+ > declares vertex-stage structured buffers as `std140` UBOs when it emits the
179
+ > shader, with real bindings, rather than rewriting text afterwards — see
180
+ > `DxbcGlslEmitter.js`, the `dcl_resource_structured` vertex branch. The
181
+ > regex functions it describes were deleted from
182
+ > `scripts/packageTr2WebglEffect.js`, so the line citations below point at
183
+ > nothing. The section is kept because it records *why* each rewrite was
184
+ > needed, which the ccpwgl runtime ABI still constrains; read it as history,
185
+ > not as a description of the code.
178
186
  1. Strip the `#ifdef GL_ARB_shader_storage_buffer_object` /
179
187
  `GL_ARB_shader_image_load_store` extension guard blocks (regexes at
180
188
  `packageTr2WebglEffect.js:832-833`).
@@ -215,7 +223,7 @@ runnable WebGL2 GLSL for, restricted to the `BoneTransforms` skinning case
215
223
  place** (`packageTr2WebglEffect.js:886,890,895,898` all `return match`) —
216
224
  this is a silent-failure edge case the implementing engineer must guard
217
225
  against (add a diagnostic) rather than trust to fail loudly.
218
- 8. If any rewrite happened, inject a `// CEWG: BoneTransforms lowered to cb3
226
+ 8. If any rewrite happened, inject a `// Carbon WebGL: BoneTransforms lowered to cb3
219
227
  JointMat rows.` marker comment after `#version 300 es`
220
228
  (`packageTr2WebglEffect.js:859-861`).
221
229
 
@@ -229,8 +237,19 @@ pixel `usampler2D` data textures (see `DxbcGlslEmitter.js` `dcl_resource_structu
229
237
  pixel branch), which compiles but consumes a texture unit each; on real drivers
230
238
  the `_depth` quad variants overflow `MAX_TEXTURE_IMAGE_UNITS`(16).
231
239
 
232
- **Resolution (2026-07-08) — stub, not rewrite.** Since CEWG does not support this
233
- tiled lighting, the packager can DROP it instead of lowering it. Run
240
+ **Superseded (2026-08-02) — the lights fit, and are kept.** The two light
241
+ buffers now lower to a single packed `RGBA32UI` data texture rather than one
242
+ texture each, which frees two units, and the `Detail1/2/3Map` textures merge into
243
+ one array texture, which frees one or two more. Both `.sm_depth` quad variants
244
+ land at or under 16 with lighting intact: `unpackedskinned_quaddetailv5` at 15,
245
+ `unpackedskinned_quadheatdetailv5` at 16. See
246
+ `/docs/contracts/webgl2-texture-budget.md`. Dropping the lights is still
247
+ available as `--stub-light-resources` for isolating a lighting problem, but it is
248
+ no longer the answer to the budget. The paragraph below describes that opt-in
249
+ path and remains accurate.
250
+
251
+ **Earlier resolution (2026-07-08) — stub, not rewrite.** Since Carbon WebGL does not
252
+ support this tiled lighting, the packager can DROP it instead of lowering it. Run
234
253
  `packageTr2WebglEffect.js --stub-light-resources`: it resolves the light resource
235
254
  names (`LightBuffer`, `LightIndexBuffer`, `LightProfileArray`) to `t#` registers
236
255
  from the Carbon `.sm` reflection (RDEF is stripped, so names live only there —
@@ -239,7 +258,7 @@ sb11/sb12/s13) and passes them to `emitGlsl` as `stubResourceRegisters`. The
239
258
  emitter then drops their decl+binding and lowers reads to `uintBitsToFloat(0u)`
240
259
  (structured) / `vec4(0.0)` (sampled) — zeroing the per-tile light count makes the
241
260
  light loop dead. The packager also strips those `resource` bindings from the
242
- manifest JSON (`stripLightResourcesFromManifest`) so the CEWG runtime does not
261
+ manifest JSON (`stripLightResourcesFromManifest`) so the Carbon WebGL runtime does not
243
262
  synthesize a texture def (glType 0 → "Invalid shader texture definition") for the
244
263
  now-undeclared light buffers. Opt-in, default off; every other package is
245
264
  unchanged. A functional light constant-buffer path remains possible but was not
@@ -74,7 +74,7 @@ Ground truth: `toGLSLOperand.cpp:1738-1882` (`ResourceName`, `TextureSamplerName
74
74
  `ResourceName`, when `useCombinedTextureSamplers` is true — `toGLSLInstruction.cpp:1332-1336`).
75
75
  This is deliberate register-identity preservation per `CARBONENGINEJS-FORK.md`
76
76
  ("emitting deterministic register-stable GLSL symbols such as `cb3`, `t0`, and `s0`" /
77
- "preserving enough register identity for `Tr2EffectBindingManifest`... and eventual
77
+ "preserving enough register identity for `HlslEffectBindingManifest`... and eventual
78
78
  trinityjs binding work"): the emitter must keep declaring the bare `t#` uniform even
79
79
  though the sampling calls use the combined name, so downstream tooling can still find a
80
80
  `t#`-named uniform to correlate against Carbon metadata.
@@ -3,7 +3,7 @@
3
3
  Status: Evolving
4
4
  Scope: `@carbonenginejs/runtime-resource/formats/webgpu`
5
5
  Audience: Shader-tool authors, engine integrators, and maintainers
6
- Summary: Explains the Carbon-record CEWGPU format, compiled-effect conversion API, and bounded DXBC-to-WGSL compiler.
6
+ Summary: Explains the Carbon-record Carbon WebGPU format, compiled-effect conversion API, and bounded DXBC-to-WGSL compiler.
7
7
 
8
8
  ## Purpose
9
9
 
@@ -26,7 +26,7 @@ translation gate. Backend and runtime completeness remain broader gates.
26
26
 
27
27
  Use the WebGPU format subpath when you need to:
28
28
 
29
- - inspect or build a `.cewgpu` package;
29
+ - inspect or build a `.carbonwebgpu` package;
30
30
  - analyze caller-supplied compiled effect bytes;
31
31
  - lower supported DXBC vertex and fragment programs to WGSL;
32
32
  - build one collision-free WebGPU binding layout across a complete pass; or
@@ -79,6 +79,6 @@ For compiled-effect conversion, continue with the
79
79
  - [Architecture and boundaries](architecture.md)
80
80
  - [Effect packaging guide](guides/effect-packaging.md)
81
81
  - [Public API reference](reference/api.md)
82
- - [CEWGPU package format](formats/cewgpu.md)
82
+ - [Carbon WebGPU package format](formats/carbon-webgpu.md)
83
83
  - [WGSL compatibility](reference/wgsl-compatibility.md)
84
84
  - [Class-purpose catalog](reference/classes/README.md)
@@ -23,7 +23,7 @@ creating live GPU objects.
23
23
  @carbonenginejs/runtime-resource/formats/webgpu <---- @carbonenginejs/runtime-resource/formats/dxbc
24
24
  | decoded DXBC
25
25
  |
26
- +---- CEWGPU bytes, analysis, WGSL, canonical layouts
26
+ +---- Carbon WebGPU bytes, analysis, WGSL, canonical layouts
27
27
  |
28
28
  v
29
29
  @carbonenginejs/engine-webgpu
@@ -35,7 +35,7 @@ then package data to the engine.
35
35
 
36
36
  ## Owned responsibilities
37
37
 
38
- - Reading, inspecting, and building Carbon-record CEWGPU containers.
38
+ - Reading, inspecting, and building Carbon-record Carbon WebGPU containers.
39
39
  - Resolving one compiled-effect permutation and complete pass.
40
40
  - Preserving every source permutation row and representable non-program
41
41
  description field; non-dynamic sampler names are unrecoverable and stage
@@ -55,8 +55,7 @@ then package data to the engine.
55
55
  ## Ownership elsewhere
56
56
 
57
57
  - `@carbonenginejs/runtime-resource/formats/hlsl` owns compiled-effect parsing, permutation resolution,
58
- unique-body enumeration, binding-manifest interpretation, and the shared
59
- body-local portable reflection schema/validator.
58
+ unique-body enumeration, and binding-manifest interpretation.
60
59
  - `@carbonenginejs/runtime-resource/formats/dxbc` owns DXBC container and instruction decoding.
61
60
  - `@carbonenginejs/engine-webgpu` owns `GPUDevice`, shader-module compilation, bind groups,
62
61
  pipelines, resource realization, device loss, and draw execution.
@@ -71,7 +70,7 @@ then package data to the engine.
71
70
 
72
71
  The public class accepts `ArrayBuffer`, typed-array, and compatible byte views.
73
72
  Its source does not read files, inspect processes, or invoke native programs.
74
- This allows applications to fetch or select bytes and build CEWGPU data in a
73
+ This allows applications to fetch or select bytes and build Carbon WebGPU data in a
75
74
  browser.
76
75
 
77
76
  The repository's command-line scripts are development adapters over the same
@@ -92,5 +91,5 @@ listed in [WGSL compatibility](reference/wgsl-compatibility.md).
92
91
  ## Related documentation
93
92
 
94
93
  - [Package documentation](README.md)
95
- - [CEWGPU package format](formats/cewgpu.md)
94
+ - [Carbon WebGPU package format](formats/carbon-webgpu.md)
96
95
  - [Public API reference](reference/api.md)
@@ -1,4 +1,4 @@
1
- # CEWGPU effect container
1
+ # Carbon WebGPU effect container
2
2
 
3
3
  Status: Evolving
4
4
  Scope: `@carbonenginejs/runtime-resource/formats/webgpu`
@@ -7,7 +7,7 @@ Summary: Defines the Carbon v15 record container used for WebGPU effects, its ba
7
7
 
8
8
  ## Purpose
9
9
 
10
- A `.cewgpu` file is a stock Carbon version-15 compiled-effect container whose
10
+ A `.carbonwebgpu` file is a stock Carbon version-15 compiled-effect container whose
11
11
  program slots carry WGSL instead of DXBC. It preserves every permutation row
12
12
  and representable non-program description/reflection fields. Non-dynamic
13
13
  sampler names are unrecoverable and stage order is canonicalized. Source-stage
@@ -15,10 +15,10 @@ programs are not stored: a translated slot contains WGSL and an untranslated slo
15
15
  Each translated pass may also carry one WebGPU backend block containing
16
16
  bind-group layouts and resource transforms.
17
17
 
18
- There is no CEWGPU-specific magic, envelope, payload tag, or container version.
18
+ There is no Carbon WebGPU-specific magic, envelope, payload tag, or container version.
19
19
  Backend identity comes from the resource path, such as `effect.webgpu/`, just
20
20
  as Carbon selects `effect.dx11/`, `effect.dx12/`, or `effect.metal/`.
21
- `isCewgpu(bytes)` is therefore only a Carbon-v15 shape check. It cannot prove
21
+ `isCarbonWebgpu(bytes)` is therefore only a Carbon-v15 shape check. It cannot prove
22
22
  that arbitrary version-15 bytes contain WGSL.
23
23
 
24
24
  ## Wire layout
@@ -34,7 +34,7 @@ outline, the file contains:
34
34
  emitted-description-byte aliases sharing that body; and
35
35
  - one optional backend block after each pass's render states.
36
36
 
37
- The Carbon region is backend-invariant. CEWGPU substitutes:
37
+ The Carbon region is backend-invariant. Carbon WebGPU substitutes:
38
38
 
39
39
  - UTF-8 WGSL in each translated stage's `shaderData`;
40
40
  - the fixed entry point `main`, which is omitted from the wire because every
@@ -48,7 +48,7 @@ remain represented without pretending WebGPU can execute them.
48
48
 
49
49
  ## No stored chunks
50
50
 
51
- The former flat CEWGPU format stored `INFO`, `META`, `PGRF`, `RFLX`, `RBLB`,
51
+ The former flat Carbon WebGPU format stored `INFO`, `META`, `PGRF`, `RFLX`, `RBLB`,
52
52
  `ANLS`, `WGSL`, and `WGSB` chunks. The current wire stores none of them.
53
53
 
54
54
  Equivalent read surfaces are derived from the one Carbon record tree:
@@ -65,19 +65,18 @@ Equivalent read surfaces are derived from the one Carbon record tree:
65
65
 
66
66
  `Read(..., { emit: "json" })` returns these compatibility views as plain data.
67
67
  They are not independent stored documents and carry no cross-document digests.
68
- `Read(..., { emit: "raw" })` returns the internal `CewgpuContainer` reader.
68
+ `Read(..., { emit: "raw" })` returns the internal `CarbonWebgpuContainer` reader.
69
69
  There is no `chunks` array and no generic `Build(chunks)` API.
70
70
 
71
71
  ## Building
72
72
 
73
73
  `BuildEffect` accepts version-15 compiled-effect bytes only. It parses the
74
74
  complete input, resolves the requested permutation, lowers selected programs,
75
- and writes a new Carbon v15 container. Full portable source reflection exists
76
- in the in-memory build result; source-stage program bytes and the caller's
77
- source hash are not retained in the emitted wire.
75
+ and writes a new Carbon v15 container. Source-stage program bytes and the
76
+ caller's source hash are not retained in the emitted wire.
78
77
 
79
78
  The returned build record is richer than the bytes. Its `info`, `metadata`,
80
- `permutationGraph`, `reflection`, `analysis`, `wgsl`, `backendBodySet`, and
79
+ `permutationGraph`, `analysis`, `wgsl`, `backendBodySet`, `inspection`, and
81
80
  `qualification` fields are build-time evidence for callers. They must not be
82
81
  interpreted as separate records stored in the container.
83
82
 
@@ -1,9 +1,9 @@
1
- # Build a CEWGPU package from compiled effect bytes
1
+ # Build a Carbon WebGPU package from compiled effect bytes
2
2
 
3
3
  Status: Evolving
4
4
  Scope: `@carbonenginejs/runtime-resource/formats/webgpu`
5
5
  Audience: Shader-tool authors and engine integrators
6
- Summary: Shows how to translate version-15 compiled effects into Carbon-record CEWGPU bytes.
6
+ Summary: Shows how to translate version-15 compiled effects into Carbon-record Carbon WebGPU bytes.
7
7
 
8
8
  ## Purpose
9
9
 
@@ -57,8 +57,8 @@ The emitted bytes are a stock Carbon v15 effect container:
57
57
  - translated passes may carry a WebGPU backend block with bind-group layouts
58
58
  and resource transforms.
59
59
 
60
- Source-stage DXBC and the original source hash are not stored in CEWGPU bytes.
61
- Full portable source reflection remains available only in the in-memory
60
+ Source-stage DXBC and the original source hash are not stored in Carbon WebGPU bytes.
61
+ The build result no longer carries any source-reflection document; it was removed with the intermediate format. What remains in memory is
62
62
  `BuildEffect` result.
63
63
 
64
64
  There are no stored `INFO`, `META`, `PGRF`, `RFLX`, `ANLS`, `WGSL`, or `WGSB`
@@ -96,12 +96,10 @@ The returned record contains build-time evidence in addition to `bytes`:
96
96
 
97
97
  | Field | Purpose |
98
98
  | --- | --- |
99
- | `bytes` | Carbon v15 CEWGPU bytes. |
99
+ | `bytes` | Carbon v15 Carbon WebGPU bytes. |
100
100
  | `info` | Producer, source, translation-scope, and completeness evidence. |
101
101
  | `metadata` | Resolved selection and caller provenance. |
102
102
  | `permutationGraph` | Complete source permutation and body-alias view. |
103
- | `reflection` | Complete portable source reflection used while building. |
104
- | `reflectionBlobs` | Exact portable-reflection payload bytes. |
105
103
  | `analysis` | Selected-body diagnostic analysis. |
106
104
  | `wgsl` | Emitted shaders, layouts, and transforms. |
107
105
  | `backendBodySet` | All-body translation result, or `null` in selected mode. |
@@ -185,7 +183,7 @@ in-memory derived status.
185
183
 
186
184
  ## Related documentation
187
185
 
188
- - [CEWGPU effect container](../formats/cewgpu.md)
186
+ - [Carbon WebGPU effect container](../formats/carbon-webgpu.md)
189
187
  - [Public API reference](../reference/api.md)
190
188
  - [WGSL compatibility](../reference/wgsl-compatibility.md)
191
189
  - [Carbon compiled-effect container](../../carbon-effect-container.md)
@@ -39,10 +39,10 @@ const reader = new WebgpuFormat({
39
39
  | `SetClass(type, Class)` | Registers or removes one constructor. |
40
40
  | `GetClass(type)` | Returns one registered constructor. |
41
41
  | `HasClass(type)` | Reports whether a constructor is registered. |
42
- | `Read(bytes, options?)` | Reads Carbon-record CEWGPU bytes. |
42
+ | `Read(bytes, options?)` | Reads Carbon-record Carbon WebGPU bytes. |
43
43
  | `Inspect(bytes, options?)` | Returns a compact container summary. |
44
44
  | `AnalyzeEffect(bytes, options?)` | Analyzes compiled-effect bytes without packaging. |
45
- | `BuildEffect(bytes, options?)` | Translates a version-15 effect to CEWGPU bytes. |
45
+ | `BuildEffect(bytes, options?)` | Translates a version-15 effect to Carbon WebGPU bytes. |
46
46
  | `BuildShaderIr(input, options?)` | Builds validated shader IR from DXBC or decoded input. |
47
47
  | `BuildWgsl(input, options?)` | Emits supported shader IR as WGSL. |
48
48
  | `BuildWgslBindingPlan(programs, options?)` | Allocates one binding layout across a pass. |
@@ -56,18 +56,18 @@ not a generic chunk container.
56
56
 
57
57
  | Static helper | Purpose |
58
58
  | --- | --- |
59
- | `isCewgpu(bytes)` | Reports whether bytes have the Carbon-v15 shape. |
59
+ | `isCarbonWebgpu(bytes)` | Reports whether bytes have the Carbon-v15 shape. |
60
60
  | `read(bytes, options?)` | Reads one container. |
61
61
  | `inspect(bytes, options?)` | Inspects one container. |
62
62
  | `analyzeEffect(bytes, options?)` | Analyzes one compiled effect. |
63
- | `buildEffect(bytes, options?)` | Builds CEWGPU bytes from a version-15 effect. |
63
+ | `buildEffect(bytes, options?)` | Builds Carbon WebGPU bytes from a version-15 effect. |
64
64
  | `buildShaderIr(input, options?)` | Builds shader IR. |
65
65
  | `buildWgsl(input, options?)` | Emits WGSL. |
66
66
  | `buildWgslBindingPlan(programs, options?)` | Allocates a pass binding plan. |
67
67
  | `buildWgslSet(entries)` | Builds a portable WGSL set. |
68
68
  | `toJSON(value)` | Converts output to JSON-compatible data. |
69
69
 
70
- `isCewgpu` checks the first dword for Carbon version 15. CEWGPU has no private
70
+ `isCarbonWebgpu` checks the first dword for Carbon version 15. Carbon WebGPU has no private
71
71
  magic or payload tag, so this is a shape check rather than backend identity.
72
72
  Callers establish identity through the resource path that supplied the bytes.
73
73
 
@@ -114,11 +114,10 @@ DXBC instructions and compiler IR.
114
114
 
115
115
  `BuildEffect` is narrower: current packaging requires the version-15 record
116
116
  layout. The wire retains every permutation row and non-program description
117
- field that the mapping can represent; non-dynamic sampler names are
118
- unrecoverable and stage order is canonicalized. Source-stage DXBC and the
119
- caller's source hash are not retained in the wire. The build result retains
120
- full portable source reflection, including source program bytes. Compiler IR
121
- is transient and is neither stored in the wire nor returned by `BuildEffect`.
117
+ field that the mapping can represent, including non-dynamic sampler names and
118
+ the file's authored pass-stage order. Source-stage DXBC and the caller's source
119
+ hash are not retained in the wire. Compiler IR is transient and is neither
120
+ stored in the wire nor returned by `BuildEffect`.
122
121
 
123
122
  Unknown, duplicate, or unresolved permutation assertions fail closed.
124
123
 
@@ -148,7 +147,7 @@ consumer's resource path.
148
147
 
149
148
  - `bytes`;
150
149
  - build-time `info` and `metadata`;
151
- - `permutationGraph`, portable `reflection`, and `reflectionBlobs`;
150
+ - `permutationGraph`;
152
151
  - selected `analysis` and `wgsl`;
153
152
  - `backendBodySet` for all mode;
154
153
  - an `inspection` obtained by rereading the emitted bytes; and
@@ -192,6 +191,6 @@ points, and malformed backend blocks.
192
191
  ## Related documentation
193
192
 
194
193
  - [Effect packaging guide](../guides/effect-packaging.md)
195
- - [CEWGPU effect container](../formats/cewgpu.md)
194
+ - [Carbon WebGPU effect container](../formats/carbon-webgpu.md)
196
195
  - [WGSL compatibility](wgsl-compatibility.md)
197
196
  - [Class-purpose catalog](classes/README.md)
@@ -1273,10 +1273,10 @@ used before the Carbon-container switchover. Their corpus counts remain
1273
1273
  compiler and provenance evidence; `INFO`, `META`, `PGRF`, `RFLX`, `RBLB`,
1274
1274
  `ANLS`, and `WGSL` are no longer stored chunks. Current bytes are Carbon
1275
1275
  version-15 records with derived compatibility views. See
1276
- [CEWGPU effect container](../formats/cewgpu.md).
1276
+ [Carbon WebGPU effect container](../formats/carbon-webgpu.md).
1277
1277
 
1278
1278
  At the 0.4.2 checkpoint, `BuildEffect` emitted selected-effect INFO schema
1279
- version 2 while the binary CEWGPU container remained version 1. INFO v2
1279
+ version 2 while the binary Carbon WebGPU container remained version 1. INFO v2
1280
1280
  recorded the WebGPU target,
1281
1281
  backend-package and translator semantic versions, and a lower-case SHA-256
1282
1282
  digest computed over the exact compiled-effect input byte view. A conflicting
@@ -1311,9 +1311,8 @@ are unchanged; old readers tolerate the additive chunk.
1311
1311
 
1312
1312
  The 0.4.4 selected-reflection checkpoint adds complete version-15 reflection
1313
1313
  for the selected body in `RFLX`, with every exact byte vector externalized into
1314
- canonical deduplicated `RBLB` records. The upstream
1315
- `@carbonenginejs/runtime-resource/formats/hlsl/portable` v1 validator is rerun after
1316
- reconstruction; package validation also reconciles INFO source identity,
1314
+ canonical deduplicated `RBLB` records. A body-reflection validator was rerun
1315
+ after reconstruction; package validation also reconciles INFO source identity,
1317
1316
  META/PGRF body identity, and every ANLS pass/stage source record. Earlier
1318
1317
  effect versions retain the legacy package surface. All-body reflection remains
1319
1318
  unsupported, so source/backend/runtime completeness remain false.
@@ -1335,7 +1334,7 @@ qualified packages:
1335
1334
  A packed-package Chrome smoke builds and reads a real version-15 effect in the
1336
1335
  browser, resolves all reflected byte references, structured-clones the JSON
1337
1336
  view, and fails closed after raw blob corruption with no console errors. The
1338
- engine prepares a newly generated real `quads.sm_hi` CEWGPU package with 10
1337
+ engine prepares a newly generated real `quads.sm_hi` Carbon WebGPU package with 10
1339
1338
  canonical bindings and zero WGSL warnings. The high-tier
1340
1339
  `unpacked_quadv5.sm_depth` DX11 self-pair remains exhaustively qualified across
1341
1340
  480 bodies, 4,480 emitted stage occurrences, and 2,240 ready pass occurrences;
@@ -1347,8 +1346,12 @@ reflection for every unique version-15 source body while ANLS/WGSL remain
1347
1346
  selected-backend data. `GetPortableEffectReflection(permutationIndex)` exposes
1348
1347
  any package permutation as a fresh, format-hlsl-validated document with owned
1349
1348
  byte payloads. `runtime-resource` owns `Tr2EffectRes` selection, canonical
1350
- `Tr2Shader` hydration, and the per-index cache; renderer-owned handles remain
1351
- an engine concern.
1349
+ `Tr2Shader` construction, and the per-index cache; renderer-owned handles
1350
+ remain an engine concern.
1351
+
1352
+ That RFLX/RBLB apparatus and its accessor were removed after this checkpoint.
1353
+ `Tr2EffectRes` now reads the Carbon container directly; the entries above are
1354
+ retained as the record of what the format did at the time.
1352
1355
 
1353
1356
  An exhaustive build-3444265 oracle retains 507 qualified, 30 unsupported, and
1354
1357
  zero failed/unqualified results. For all 507 emitted packages, `META`, `PGRF`,