@carbonenginejs/runtime-resource 0.18.0 → 0.18.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 (72) hide show
  1. package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +16 -4
  2. package/dist/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -1
  3. package/dist/format/carbonEffect/buildCarbonEffectContainer.js +11 -1
  4. package/dist/format/carbonEffect/buildCarbonEffectContainer.js.map +1 -1
  5. package/dist/format/carbonEffect/carbonEffectBackendBlock.js +36 -0
  6. package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
  7. package/dist/format/carbonEffect/carbonEffectRecords.js +45 -1
  8. package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -1
  9. package/dist/format/carbonEffect/carbonEffectResourceTransform.js +120 -60
  10. package/dist/format/carbonEffect/carbonEffectResourceTransform.js.map +1 -1
  11. package/dist/format/index.js +1 -1
  12. package/dist/formats/dds/core/helpers.js +35 -6
  13. package/dist/formats/dds/core/helpers.js.map +1 -1
  14. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +53 -1
  15. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
  16. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +10 -1
  17. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js.map +1 -1
  18. package/dist/formats/index.js +3 -0
  19. package/dist/formats/index.js.map +1 -1
  20. package/dist/formats/schemabound/CjsSchemaBoundFormat.js +236 -0
  21. package/dist/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -0
  22. package/dist/formats/schemabound/core/schemaBoundErrors.js +9 -0
  23. package/dist/formats/schemabound/core/schemaBoundErrors.js.map +1 -0
  24. package/dist/formats/schemabound/core/schemaBoundValues.js +307 -0
  25. package/dist/formats/schemabound/core/schemaBoundValues.js.map +1 -0
  26. package/dist/formats/schemabound/index.js +2 -0
  27. package/dist/formats/schemabound/index.js.map +1 -0
  28. package/dist/formats/sqlite/CjsSqliteFormat.js +244 -0
  29. package/dist/formats/sqlite/CjsSqliteFormat.js.map +1 -0
  30. package/dist/formats/sqlite/core/sqlitePages.js +159 -0
  31. package/dist/formats/sqlite/core/sqlitePages.js.map +1 -0
  32. package/dist/formats/sqlite/core/sqliteRecords.js +174 -0
  33. package/dist/formats/sqlite/core/sqliteRecords.js.map +1 -0
  34. package/dist/formats/sqlite/core/sqliteSchema.js +100 -0
  35. package/dist/formats/sqlite/core/sqliteSchema.js.map +1 -0
  36. package/dist/formats/sqlite/index.js +2 -0
  37. package/dist/formats/sqlite/index.js.map +1 -0
  38. package/dist/formats/static/CjsStaticFormat.js +220 -0
  39. package/dist/formats/static/CjsStaticFormat.js.map +1 -0
  40. package/dist/formats/static/index.js +2 -0
  41. package/dist/formats/static/index.js.map +1 -0
  42. package/dist/formats/webgl/core/buildGlslEffectContainer.js +3 -1
  43. package/dist/formats/webgl/core/buildGlslEffectContainer.js.map +1 -1
  44. package/dist/formats/webgl/core/effectPackage.js +11 -2
  45. package/dist/formats/webgl/core/effectPackage.js.map +1 -1
  46. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +10 -2
  47. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  48. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +3 -1
  49. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -1
  50. package/dist/formats/webgpu/core/carbonWebgpu/containerViews.js +179 -131
  51. package/dist/formats/webgpu/core/carbonWebgpu/containerViews.js.map +1 -1
  52. package/dist/formats/webgpu/core/effectBackendBodySet.js +20 -20
  53. package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
  54. package/dist/formats/webgpu/core/packageEffect.js +14 -1
  55. package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
  56. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +9 -1
  57. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
  58. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +14 -0
  59. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
  60. package/docs/concepts/shader-resource-model.md +34 -1
  61. package/docs/formats/README.md +21 -0
  62. package/docs/formats/carbon-effect-container.md +54 -27
  63. package/docs/formats/schemabound.md +112 -0
  64. package/docs/formats/static.md +119 -0
  65. package/docs/formats/webgl/README.md +5 -3
  66. package/docs/formats/webgpu/README.md +2 -2
  67. package/docs/formats/webgpu/architecture.md +2 -2
  68. package/docs/formats/webgpu/formats/carbon-webgpu.md +13 -2
  69. package/docs/formats/webgpu/guides/effect-packaging.md +1 -2
  70. package/docs/formats/webgpu/reference/wgsl-compatibility.md +2 -2
  71. package/docs/reference/classes/formats.md +33 -0
  72. package/package.json +4 -1
@@ -38,8 +38,8 @@ then package data to the engine.
38
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
- description field; non-dynamic sampler names are unrecoverable and stage
42
- order is canonicalized.
41
+ description field, including non-dynamic sampler names and the authored stage
42
+ order both are preserved, whatever Carbon's runtime does with them.
43
43
  Stored-body identity is exact emitted-description-byte identity; it does not
44
44
  promise to retain the source alias partition after programs are replaced.
45
45
  - Writing WGSL to program slots and bind-group/transform data to the optional
@@ -9,12 +9,23 @@ Summary: Defines the Carbon v15 record container used for WebGPU effects, its ba
9
9
 
10
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
- and representable non-program description/reflection fields. Non-dynamic
13
- sampler names are unrecoverable and stage order is canonicalized. Source-stage
12
+ and representable non-program description/reflection fields, including
13
+ non-dynamic sampler names and the authored stage order. Source-stage
14
14
  programs are not stored: a translated slot contains WGSL and an untranslated slot is empty.
15
15
  Each translated pass may also carry one WebGPU backend block containing
16
16
  bind-group layouts and resource transforms.
17
17
 
18
+ That preservation is **inherited from the shared codec, and now pinned on this
19
+ path.** It holds because the emit round-trips the description through the same
20
+ Carbon classes the plain container uses and mutates only `stage.sourceProgram`
21
+ and `pass.backendBlock`.
22
+
23
+ `carbon-webgpu-emit-fidelity.test.mjs` compares both fields source-to-emitted
24
+ across the corpus rather than trusting that restraint: 2,960 emitted files,
25
+ 39,252 sampler names and 84,912 stage orders, of which 102 are non-canonical —
26
+ the case that distinguishes a preserved order from a re-derived one. Widening
27
+ what the emit touches now fails there instead of surfacing in a consumer later.
28
+
18
29
  There is no Carbon WebGPU-specific magic, envelope, payload tag, or container version.
19
30
  Backend identity comes from the resource path, such as `effect.webgpu/`, just
20
31
  as Carbon selects `effect.dx11/`, `effect.dx12/`, or `effect.metal/`.
@@ -50,8 +50,7 @@ The emitted bytes are a stock Carbon v15 effect container:
50
50
  - each distinct emitted description body is stored once, based on exact emitted
51
51
  bytes rather than the source alias partition;
52
52
  - representable non-program description/reflection fields remain in the Carbon
53
- tree; non-dynamic sampler names are unrecoverable and stage order is
54
- canonicalized;
53
+ tree, non-dynamic sampler names and the authored stage order included;
55
54
  - translated stage program slots contain UTF-8 WGSL;
56
55
  - untranslated or unsupported stage program slots have zero length; and
57
56
  - translated passes may carry a WebGPU backend block with bind-group layouts
@@ -1403,8 +1403,8 @@ program slots and coverage degrades to `partial`. The in-memory build result
1403
1403
  retains its specific reason; the wire does not. A reread can say only that the
1404
1404
  body carries no translated programs. Permutation topology and representable
1405
1405
  non-program description fields remain present, but source-stage programs are
1406
- not stored. Non-dynamic sampler names are unrecoverable and stage order is
1407
- canonicalized.
1406
+ not stored. Non-dynamic sampler names and the authored stage order are both
1407
+ preserved.
1408
1408
 
1409
1409
  Translating every body is deliberately **not** treated as backend completeness.
1410
1410
  `backendComplete` and `runtimeComplete` remain false, matching the sibling
@@ -689,6 +689,39 @@ Data-only Python pickle format facade that currently decodes protocol 0 into JSO
689
689
  - Visibility: Public
690
690
  - Kind: Original CarbonEngineJS class
691
691
 
692
+ <!-- class:CjsSchemaBoundFormat -->
693
+ ## `CjsSchemaBoundFormat`
694
+
695
+ Reads a binary record container against the separate schema document that describes its layout.
696
+
697
+ - Export: `@carbonenginejs/runtime-resource/formats/schemabound`
698
+ - Source: `src/formats/schemabound/CjsSchemaBoundFormat.js`
699
+ - Visibility: Public
700
+ - Kind: Original CarbonEngineJS class
701
+ - Notes: The schema is required and there is no default. These bytes carry no signature, so the wrong schema decodes into plausible nonsense rather than failing.
702
+
703
+ <!-- class:CjsSqliteFormat -->
704
+ ## `CjsSqliteFormat`
705
+
706
+ Reads a SQLite 3 container as data: the tables it holds and every row of them, with no SQL and no query engine.
707
+
708
+ - Export: `@carbonenginejs/runtime-resource/formats/sqlite`
709
+ - Source: `src/formats/sqlite/CjsSqliteFormat.js`
710
+ - Visibility: Public
711
+ - Kind: Original CarbonEngineJS class
712
+ - Notes: Read-only and full-scan. Index b-trees are never walked, and nothing here needs a driver or a filesystem.
713
+
714
+ <!-- class:CjsStaticFormat -->
715
+ ## `CjsStaticFormat`
716
+
717
+ Identifies which of three unrelated containers a client `.static` file holds, so a caller can route it to the format that decodes it.
718
+
719
+ - Export: `@carbonenginejs/runtime-resource/formats/static`
720
+ - Source: `src/formats/static/CjsStaticFormat.js`
721
+ - Visibility: Public
722
+ - Kind: Original CarbonEngineJS class
723
+ - Notes: Signature-based, and it decodes nothing at all since 2026-08-15. It reports the family and the payload offset; `CjsPickleFormat`, `CjsSqliteFormat` and `CjsSchemaBoundFormat` decode.
724
+
692
725
  <!-- class:CjsPickleProtocol0Reader -->
693
726
  ## `CjsPickleProtocol0Reader`
694
727
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbonenginejs/runtime-resource",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "CarbonEngineJS resource lifecycle, cache, source, and object loading contracts.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -39,6 +39,9 @@
39
39
  "./formats/png": "./dist/formats/png/index.js",
40
40
  "./formats/red": "./dist/formats/red/index.js",
41
41
  "./formats/red/schema": "./dist/formats/red/core/blackDefinitions.js",
42
+ "./formats/schemabound": "./dist/formats/schemabound/index.js",
43
+ "./formats/sqlite": "./dist/formats/sqlite/index.js",
44
+ "./formats/static": "./dist/formats/static/index.js",
42
45
  "./formats/stl": "./dist/formats/stl/index.js",
43
46
  "./formats/tga": "./dist/formats/tga/index.js",
44
47
  "./formats/wav": "./dist/formats/wav/index.js",