@plasius/gpu-shader 0.1.0 → 0.1.2

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.
package/dist/node.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { ac as ReflectGpuInterfaceInput, G as GpuInterfaceManifest, j as ShaderResult, t as GeneratedGpuInterfaceArtifacts, aH as ShaderQualificationBundleManifest, g as ShaderVersionManifestCore, aL as ShaderQualificationFixtureManifest, M as ModelGpuCompatibilityDescriptor, e as GpuRecordLayout, B as GpuBindingResourceLayout, W as GpuOverrideLayout, a9 as GpuWorkgroupDimension } from './contracts-C4eel8MT.cjs';
1
+ import { ac as ReflectGpuInterfaceInput, G as GpuInterfaceManifest, j as ShaderResult, t as GeneratedGpuInterfaceArtifacts, aH as ShaderQualificationBundleManifest, g as ShaderVersionManifestCore, aL as ShaderQualificationFixtureManifest, M as ModelGpuCompatibilityDescriptor, e as GpuRecordLayout, B as GpuBindingResourceLayout, W as GpuOverrideLayout, a9 as GpuWorkgroupDimension } from './contracts-B49AUejk.cjs';
2
2
 
3
3
  /** Reflects final assembled WGSL; selectors can identify data but never supply layout numbers. */
4
4
  declare function reflectGpuInterface(input: ReflectGpuInterfaceInput): Promise<GpuInterfaceManifest>;
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ac as ReflectGpuInterfaceInput, G as GpuInterfaceManifest, j as ShaderResult, t as GeneratedGpuInterfaceArtifacts, aH as ShaderQualificationBundleManifest, g as ShaderVersionManifestCore, aL as ShaderQualificationFixtureManifest, M as ModelGpuCompatibilityDescriptor, e as GpuRecordLayout, B as GpuBindingResourceLayout, W as GpuOverrideLayout, a9 as GpuWorkgroupDimension } from './contracts-C4eel8MT.js';
1
+ import { ac as ReflectGpuInterfaceInput, G as GpuInterfaceManifest, j as ShaderResult, t as GeneratedGpuInterfaceArtifacts, aH as ShaderQualificationBundleManifest, g as ShaderVersionManifestCore, aL as ShaderQualificationFixtureManifest, M as ModelGpuCompatibilityDescriptor, e as GpuRecordLayout, B as GpuBindingResourceLayout, W as GpuOverrideLayout, a9 as GpuWorkgroupDimension } from './contracts-B49AUejk.js';
2
2
 
3
3
  /** Reflects final assembled WGSL; selectors can identify data but never supply layout numbers. */
4
4
  declare function reflectGpuInterface(input: ReflectGpuInterfaceInput): Promise<GpuInterfaceManifest>;
package/dist/node.js CHANGED
@@ -5834,7 +5834,7 @@ var SUPPORTED_STABLE_WEBGPU_MATRIX_POLICIES = [
5834
5834
  Object.freeze({
5835
5835
  matrixId: "stable-webgpu",
5836
5836
  matrixVersion: "2026-07-13",
5837
- matrixSha256: "9b47ff8162b055d49e38c4fe90b9074992ab8c9e1125926e936f8122e6119fd8"
5837
+ matrixSha256: "4620eca44fd03004ee7650cfe9fcf42934493611a5097da5525f71578980b016"
5838
5838
  })
5839
5839
  ];
5840
5840
  Object.freeze(SUPPORTED_STABLE_WEBGPU_MATRIX_POLICIES);
@@ -5960,6 +5960,29 @@ ${canonicalizeGpuContract(core)}`
5960
5960
  );
5961
5961
  }
5962
5962
 
5963
+ // src/asset-version.ts
5964
+ var ASSET_VERSION_PATTERN = /^[0-9A-Za-z][0-9A-Za-z._-]{0,127}$/u;
5965
+ var MUTABLE_VERSION_ALIASES = /* @__PURE__ */ new Set([
5966
+ "latest",
5967
+ "current",
5968
+ "stable",
5969
+ "preview",
5970
+ "default",
5971
+ "production",
5972
+ "canary",
5973
+ "next",
5974
+ "head",
5975
+ "main"
5976
+ ]);
5977
+ var X_WILDCARD_SEGMENT_PATTERN = /^(?:[vV])?[xX](?:\.|-|$)|\.[xX](?:\.|-|$)/u;
5978
+ var IMMUTABLE_VERSION_ERROR_MESSAGE = "Immutable asset version must be an exact token up to 128 characters; mutable aliases, ranges, wildcards, and URLs are not allowed.";
5979
+ function assertImmutableAssetVersion(value) {
5980
+ if (typeof value !== "string" || !ASSET_VERSION_PATTERN.test(value) || MUTABLE_VERSION_ALIASES.has(value.toLowerCase()) || X_WILDCARD_SEGMENT_PATTERN.test(value)) {
5981
+ throw new TypeError(IMMUTABLE_VERSION_ERROR_MESSAGE);
5982
+ }
5983
+ return value;
5984
+ }
5985
+
5963
5986
  // src/requirements-validation.ts
5964
5987
  var ENABLED_FEATURES = Object.freeze({
5965
5988
  f16: "shader-f16",
@@ -6287,6 +6310,15 @@ function validateShaderDerivedRequirements(input) {
6287
6310
  // src/manifest-validation.ts
6288
6311
  var stages = ["vertex", "fragment", "compute"];
6289
6312
  var roles = ["material", "lighting", "outline", "shadow", "post-processing"];
6313
+ function detachedJson(value, path2) {
6314
+ try {
6315
+ return JSON.parse(canonicalizeGpuContract(value));
6316
+ } catch (cause) {
6317
+ const detail = cause instanceof Error ? cause.message : "Contract snapshot failed.";
6318
+ const boundedDetail = [...detail].slice(0, 512).join("");
6319
+ throw new TypeError(`${path2} must contain detached JSON contract data: ${boundedDetail}`, { cause });
6320
+ }
6321
+ }
6290
6322
  function object(value, path2) {
6291
6323
  if (typeof value !== "object" || value === null || Array.isArray(value)) throw new TypeError(`${path2} must be an object.`);
6292
6324
  return value;
@@ -6307,6 +6339,16 @@ function token(value, path2) {
6307
6339
  if (!/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u.test(result) || result.includes("..")) throw new TypeError(`${path2} must be a safe token.`);
6308
6340
  return result;
6309
6341
  }
6342
+ function immutableVersion(value, path2) {
6343
+ try {
6344
+ return assertImmutableAssetVersion(value);
6345
+ } catch (cause) {
6346
+ throw new TypeError(
6347
+ `${path2} must be an immutable asset version: exact token required; mutable aliases, ranges, wildcards, and URLs are not allowed.`,
6348
+ { cause }
6349
+ );
6350
+ }
6351
+ }
6310
6352
  function enumeration(value, values, path2) {
6311
6353
  if (!values.includes(value)) throw new TypeError(`${path2} is invalid.`);
6312
6354
  return value;
@@ -6580,7 +6622,7 @@ function interfaceRef(value, path2) {
6580
6622
  const input = object(value, path2);
6581
6623
  exact(input, ["interfaceId", "interfaceVersion", "manifestUri", "manifestSha256", "interfaceAbiHash", "modelAbiHash"], path2);
6582
6624
  token(input.interfaceId, `${path2}.interfaceId`);
6583
- token(input.interfaceVersion, `${path2}.interfaceVersion`);
6625
+ immutableVersion(input.interfaceVersion, `${path2}.interfaceVersion`);
6584
6626
  uri(input.manifestUri, `${path2}.manifestUri`);
6585
6627
  digest(input.manifestSha256, `${path2}.manifestSha256`);
6586
6628
  digest(input.interfaceAbiHash, `${path2}.interfaceAbiHash`);
@@ -6718,7 +6760,7 @@ function pipeline(value, path2, moduleIds) {
6718
6760
  return input;
6719
6761
  }
6720
6762
  function parseSerializableGpuPipelineDescriptors(value, moduleIds, path2 = "pipelines") {
6721
- const parsed = array(value, path2).map((item, index) => pipeline(item, `${path2}[${index}]`, new Set(moduleIds)));
6763
+ const parsed = array(detachedJson(value, path2), path2).map((item, index) => pipeline(item, `${path2}[${index}]`, new Set(moduleIds)));
6722
6764
  unique(parsed, (item) => item.pipelineId, path2);
6723
6765
  return freeze(parsed);
6724
6766
  }
@@ -6726,7 +6768,7 @@ function compatibleModel(value, path2) {
6726
6768
  const input = object(value, path2);
6727
6769
  exact(input, ["interfaceId", "interfaceVersion", "manifestSha256", "interfaceAbiHash", "modelAbiHash"], path2);
6728
6770
  token(input.interfaceId, `${path2}.interfaceId`);
6729
- token(input.interfaceVersion, `${path2}.interfaceVersion`);
6771
+ immutableVersion(input.interfaceVersion, `${path2}.interfaceVersion`);
6730
6772
  digest(input.manifestSha256, `${path2}.manifestSha256`);
6731
6773
  digest(input.interfaceAbiHash, `${path2}.interfaceAbiHash`);
6732
6774
  digest(input.modelAbiHash, `${path2}.modelAbiHash`);
@@ -6739,7 +6781,7 @@ function validationEvidenceRef(value, path2) {
6739
6781
  uri(evidence.uri, `${path2}.uri`);
6740
6782
  digest(evidence.sha256, `${path2}.sha256`);
6741
6783
  token(evidence.matrixId, `${path2}.matrixId`);
6742
- token(evidence.matrixVersion, `${path2}.matrixVersion`);
6784
+ immutableVersion(evidence.matrixVersion, `${path2}.matrixVersion`);
6743
6785
  digest(evidence.matrixSha256, `${path2}.matrixSha256`);
6744
6786
  const attestation = object(evidence.attestationRef, `${path2}.attestationRef`);
6745
6787
  exact(attestation, ["uri", "sha256"], `${path2}.attestationRef`);
@@ -6766,11 +6808,11 @@ function reflectedRecordBindingSize(record) {
6766
6808
  return Math.ceil(unrounded / record.alignment) * record.alignment;
6767
6809
  }
6768
6810
  function parseGpuInterfaceManifest(value) {
6769
- const input = object(value, "GpuInterfaceManifest");
6811
+ const input = object(detachedJson(value, "GpuInterfaceManifest"), "GpuInterfaceManifest");
6770
6812
  exact(input, ["contractVersion", "interfaceId", "interfaceVersion", "modules", "records", "bindings", "entryPoints", "vertexInputs", "overrides", "modelAbi", "modelAbiHash", "interfaceAbiHash", "generatedBy"], "GpuInterfaceManifest");
6771
6813
  if (input.contractVersion !== GPU_INTERFACE_MANIFEST_VERSION) throw new TypeError("Unsupported GPU interface contract version.");
6772
6814
  token(input.interfaceId, "GpuInterfaceManifest.interfaceId");
6773
- token(input.interfaceVersion, "GpuInterfaceManifest.interfaceVersion");
6815
+ immutableVersion(input.interfaceVersion, "GpuInterfaceManifest.interfaceVersion");
6774
6816
  const moduleValues = array(input.modules, "GpuInterfaceManifest.modules");
6775
6817
  if (moduleValues.length === 0) throw new TypeError("GpuInterfaceManifest.modules must not be empty.");
6776
6818
  const moduleIds = moduleValues.map((value2, index) => {
@@ -6952,11 +6994,11 @@ function parseGpuInterfaceManifest(value) {
6952
6994
  return freeze(input);
6953
6995
  }
6954
6996
  function parseShaderVersionManifest(value) {
6955
- const input = object(value, "ShaderVersionManifest");
6997
+ const input = object(detachedJson(value, "ShaderVersionManifest"), "ShaderVersionManifest");
6956
6998
  exact(input, ["contractVersion", "shaderId", "version", "modules", "gpuInterface", "pipelines", "renderRoles", "compatibleModelInterfaces", "requirements", "shaderAbiHash", "validationEvidence", "additionalValidationEvidence"], "ShaderVersionManifest");
6957
6999
  if (input.contractVersion !== SHADER_VERSION_MANIFEST_VERSION) throw new TypeError("Unsupported shader manifest contract version.");
6958
7000
  token(input.shaderId, "ShaderVersionManifest.shaderId");
6959
- token(input.version, "ShaderVersionManifest.version");
7001
+ immutableVersion(input.version, "ShaderVersionManifest.version");
6960
7002
  const moduleValues = array(input.modules, "ShaderVersionManifest.modules");
6961
7003
  if (moduleValues.length === 0) throw new TypeError("ShaderVersionManifest.modules must not be empty.");
6962
7004
  const moduleIds = moduleValues.map((item, index) => {
@@ -7069,7 +7111,7 @@ function parseShaderVersionManifest(value) {
7069
7111
  return freeze(input);
7070
7112
  }
7071
7113
  function parseShaderVersionManifestCore(value) {
7072
- const input = object(value, "ShaderVersionManifestCore");
7114
+ const input = object(detachedJson(value, "ShaderVersionManifestCore"), "ShaderVersionManifestCore");
7073
7115
  if ("validationEvidence" in input || "additionalValidationEvidence" in input) {
7074
7116
  throw new TypeError("ShaderVersionManifestCore must not contain validationEvidence or additionalValidationEvidence.");
7075
7117
  }
@@ -7095,10 +7137,10 @@ function parseShaderVersionManifestCore(value) {
7095
7137
  return freeze(core);
7096
7138
  }
7097
7139
  function parseModelGpuCompatibilityDescriptor(value) {
7098
- const input = object(value, "ModelGpuCompatibilityDescriptor");
7140
+ const input = object(detachedJson(value, "ModelGpuCompatibilityDescriptor"), "ModelGpuCompatibilityDescriptor");
7099
7141
  exact(input, ["modelId", "version", "gpuInterface", "modelAbiHash", "providedSemantics", "defaultStyleProfile"], "ModelGpuCompatibilityDescriptor");
7100
7142
  token(input.modelId, "ModelGpuCompatibilityDescriptor.modelId");
7101
- token(input.version, "ModelGpuCompatibilityDescriptor.version");
7143
+ immutableVersion(input.version, "ModelGpuCompatibilityDescriptor.version");
7102
7144
  const gpuInterface = interfaceRef(input.gpuInterface, "ModelGpuCompatibilityDescriptor.gpuInterface");
7103
7145
  const modelAbiHash = digest(input.modelAbiHash, "ModelGpuCompatibilityDescriptor.modelAbiHash");
7104
7146
  if (gpuInterface.modelAbiHash !== modelAbiHash) throw new TypeError("ModelGpuCompatibilityDescriptor.gpuInterface.modelAbiHash differs from modelAbiHash.");
@@ -7107,14 +7149,17 @@ function parseModelGpuCompatibilityDescriptor(value) {
7107
7149
  const profile = object(input.defaultStyleProfile, "ModelGpuCompatibilityDescriptor.defaultStyleProfile");
7108
7150
  exact(profile, ["profileId", "version", "manifestUri", "manifestSha256"], "ModelGpuCompatibilityDescriptor.defaultStyleProfile");
7109
7151
  token(profile.profileId, "ModelGpuCompatibilityDescriptor.defaultStyleProfile.profileId");
7110
- token(profile.version, "ModelGpuCompatibilityDescriptor.defaultStyleProfile.version");
7152
+ immutableVersion(profile.version, "ModelGpuCompatibilityDescriptor.defaultStyleProfile.version");
7111
7153
  uri(profile.manifestUri, "ModelGpuCompatibilityDescriptor.defaultStyleProfile.manifestUri");
7112
7154
  digest(profile.manifestSha256, "ModelGpuCompatibilityDescriptor.defaultStyleProfile.manifestSha256");
7113
7155
  }
7114
7156
  return freeze(input);
7115
7157
  }
7116
7158
  function parseShaderQualificationModelCompatibilityFixture(value) {
7117
- const input = object(value, "ShaderQualificationModelCompatibilityFixture");
7159
+ const input = object(
7160
+ detachedJson(value, "ShaderQualificationModelCompatibilityFixture"),
7161
+ "ShaderQualificationModelCompatibilityFixture"
7162
+ );
7118
7163
  exact(input, ["contractVersion", "fixtureId", "model"], "ShaderQualificationModelCompatibilityFixture");
7119
7164
  if (input.contractVersion !== SHADER_QUALIFICATION_FIXTURE_VERSION) throw new TypeError("Unsupported model compatibility fixture version.");
7120
7165
  token(input.fixtureId, "ShaderQualificationModelCompatibilityFixture.fixtureId");
@@ -7479,7 +7524,7 @@ function validatePipelineInterfaces(input) {
7479
7524
  // package.json
7480
7525
  var package_default = {
7481
7526
  name: "@plasius/gpu-shader",
7482
- version: "0.1.0",
7527
+ version: "0.1.2",
7483
7528
  description: "Reflection-first WebGPU WGSL interfaces, CPU codecs, compatibility validation, style profiles, and qualification tooling",
7484
7529
  type: "module",
7485
7530
  sideEffects: false,
@@ -8931,6 +8976,11 @@ function issue2(code, message, path2) {
8931
8976
  function object2(value) {
8932
8977
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
8933
8978
  }
8979
+ function freezeJson(value) {
8980
+ if (typeof value !== "object" || value === null || Object.isFrozen(value)) return value;
8981
+ for (const child of Object.values(value)) freezeJson(child);
8982
+ return Object.freeze(value);
8983
+ }
8934
8984
  function exactKeys(value, keys) {
8935
8985
  const expected = new Set(keys);
8936
8986
  return Object.keys(value).every((key) => expected.has(key)) && keys.every((key) => key in value);
@@ -8938,6 +8988,14 @@ function exactKeys(value, keys) {
8938
8988
  function safeToken(value) {
8939
8989
  return typeof value === "string" && /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,159}$/u.test(value) && !value.includes("..");
8940
8990
  }
8991
+ function immutableVersion2(value) {
8992
+ try {
8993
+ assertImmutableAssetVersion(value);
8994
+ return true;
8995
+ } catch {
8996
+ return false;
8997
+ }
8998
+ }
8941
8999
  function validSha(value) {
8942
9000
  try {
8943
9001
  asSha256Hex(String(value));
@@ -8947,8 +9005,20 @@ function validSha(value) {
8947
9005
  }
8948
9006
  }
8949
9007
  function validateCompileUnitInventory(value) {
8950
- const envelope = object2(value);
8951
- const candidate = envelope && "inventory" in envelope ? object2(value.inventory) : envelope;
9008
+ let snapshot;
9009
+ try {
9010
+ snapshot = JSON.parse(canonicalizeGpuContract(value));
9011
+ } catch (cause) {
9012
+ return {
9013
+ ok: false,
9014
+ diagnostics: [issue2(
9015
+ "invalid-contract",
9016
+ cause instanceof Error ? cause.message : "Compile-unit inventory must contain detached JSON data."
9017
+ )]
9018
+ };
9019
+ }
9020
+ const envelope = object2(snapshot);
9021
+ const candidate = envelope && Object.hasOwn(envelope, "inventory") ? object2(snapshot.inventory) : envelope;
8952
9022
  const diagnostics = [];
8953
9023
  if (!candidate || !exactKeys(candidate, ["contractVersion", "fragments", "compileUnits"])) {
8954
9024
  return { ok: false, diagnostics: [issue2("invalid-contract", "Compile-unit inventory has unknown or missing fields.")] };
@@ -9079,7 +9149,7 @@ function validateCompileUnitInventory(value) {
9079
9149
  diagnostics.push(issue2("invalid-contract", cause instanceof Error ? cause.message : "Compile-unit pipelines are invalid.", `${path2}.pipelines`));
9080
9150
  }
9081
9151
  const interfaceRef2 = object2(unit.interfaceRef);
9082
- if (!interfaceRef2 || !exactKeys(interfaceRef2, ["interfaceId", "interfaceVersion", "manifestUri", "manifestSha256", "interfaceAbiHash", "modelAbiHash"]) || !safeToken(interfaceRef2.interfaceId) || !safeToken(interfaceRef2.interfaceVersion) || typeof interfaceRef2.manifestUri !== "string" || !interfaceRef2.manifestUri.startsWith("https://") || !validSha(interfaceRef2.manifestSha256) || !validSha(interfaceRef2.interfaceAbiHash) || !validSha(interfaceRef2.modelAbiHash)) {
9152
+ if (!interfaceRef2 || !exactKeys(interfaceRef2, ["interfaceId", "interfaceVersion", "manifestUri", "manifestSha256", "interfaceAbiHash", "modelAbiHash"]) || !safeToken(interfaceRef2.interfaceId) || !immutableVersion2(interfaceRef2.interfaceVersion) || typeof interfaceRef2.manifestUri !== "string" || !interfaceRef2.manifestUri.startsWith("https://") || !validSha(interfaceRef2.manifestSha256) || !validSha(interfaceRef2.interfaceAbiHash) || !validSha(interfaceRef2.modelAbiHash)) {
9083
9153
  diagnostics.push(issue2("invalid-contract", "Compile-unit interfaceRef is invalid.", `${path2}.interfaceRef`));
9084
9154
  }
9085
9155
  const fixture = object2(unit.qualificationFixture);
@@ -9090,7 +9160,7 @@ function validateCompileUnitInventory(value) {
9090
9160
  for (const fragmentId of fragmentIds) {
9091
9161
  if (!covered.has(fragmentId)) diagnostics.push(issue2("uncovered-fragment", `WGSL fragment ${fragmentId} has no compile unit.`));
9092
9162
  }
9093
- return diagnostics.length > 0 ? { ok: false, diagnostics } : { ok: true, value: candidate };
9163
+ return diagnostics.length > 0 ? { ok: false, diagnostics } : { ok: true, value: freezeJson(candidate) };
9094
9164
  }
9095
9165
 
9096
9166
  // src/testing/qualification-bundle.ts
@@ -9182,6 +9252,18 @@ function object3(value, path2) {
9182
9252
  if (typeof value !== "object" || value === null || Array.isArray(value)) throw new TypeError(`${path2} must be an object.`);
9183
9253
  return value;
9184
9254
  }
9255
+ function detachedJson2(value, label) {
9256
+ try {
9257
+ return JSON.parse(canonicalizeGpuContract(value));
9258
+ } catch (cause) {
9259
+ throw new TypeError(`${label} must contain detached JSON contract data.`, { cause });
9260
+ }
9261
+ }
9262
+ function freezeJson2(value) {
9263
+ if (typeof value !== "object" || value === null || Object.isFrozen(value)) return value;
9264
+ for (const child of Object.values(value)) freezeJson2(child);
9265
+ return Object.freeze(value);
9266
+ }
9185
9267
  function exact2(value, keys, path2) {
9186
9268
  const expected = new Set(keys);
9187
9269
  if (!Object.keys(value).every((key) => expected.has(key)) || !keys.every((key) => key in value)) throw new TypeError(`${path2} has unknown or missing fields.`);
@@ -9190,6 +9272,16 @@ function token2(value, path2) {
9190
9272
  if (typeof value !== "string" || !TOKEN.test(value) || value.includes("..")) throw new TypeError(`${path2} must be a safe token.`);
9191
9273
  return value;
9192
9274
  }
9275
+ function immutableVersion3(value, path2) {
9276
+ try {
9277
+ return assertImmutableAssetVersion(value);
9278
+ } catch (cause) {
9279
+ throw new TypeError(
9280
+ `${path2} must be an immutable asset version: exact token required; mutable aliases, ranges, wildcards, and URLs are not allowed.`,
9281
+ { cause }
9282
+ );
9283
+ }
9284
+ }
9193
9285
  function path(value, label, extensions) {
9194
9286
  if (typeof value !== "string" || !SAFE_PATH2.test(value) || !extensions.some((extension) => value.endsWith(extension))) {
9195
9287
  throw new TypeError(`${label} must be a safe data-only bundle path (${extensions.join(", ")}).`);
@@ -9324,7 +9416,7 @@ function jsonValue(value, label, depth = 0) {
9324
9416
  }
9325
9417
  function validateQualificationFixture(value, unit) {
9326
9418
  try {
9327
- const fixture = object3(value, "fixture");
9419
+ const fixture = object3(detachedJson2(value, "fixture"), "fixture");
9328
9420
  exact2(fixture, ["contractVersion", "fixtureId", "resources", "bindGroups", "commands", "layoutProbes", "readbacks", "bounds"], "fixture");
9329
9421
  if (fixture.contractVersion !== SHADER_QUALIFICATION_FIXTURE_VERSION) throw new TypeError("Unsupported qualification fixture version.");
9330
9422
  token2(fixture.fixtureId, "fixture.fixtureId");
@@ -9660,14 +9752,14 @@ function validateQualificationFixture(value, unit) {
9660
9752
  }
9661
9753
  unique2(probeIds, "fixture.layoutProbes probe IDs");
9662
9754
  unique2(probeSources, "fixture.layoutProbes model sources");
9663
- return { ok: true, value: fixture };
9755
+ return { ok: true, value: freezeJson2(fixture) };
9664
9756
  } catch (cause) {
9665
9757
  return { ok: false, diagnostics: [{ code: "invalid-contract", severity: "error", message: cause instanceof Error ? cause.message : "Invalid qualification fixture." }] };
9666
9758
  }
9667
9759
  }
9668
9760
  function validateQualificationBundleManifest(value) {
9669
9761
  try {
9670
- const bundle = object3(value, "qualification");
9762
+ const bundle = object3(detachedJson2(value, "qualification"), "qualification");
9671
9763
  exact2(bundle, ["contractVersion", "inventory", "subject", "shaderManifestCorePath", "gpuInterfaceManifest", "modelCompatibilityFixtures", "modules", "fixtures"], "qualification");
9672
9764
  if (bundle.contractVersion !== SHADER_QUALIFICATION_BUNDLE_VERSION) throw new TypeError("Unsupported qualification bundle version.");
9673
9765
  const inventory = validateCompileUnitInventory(bundle.inventory);
@@ -9677,7 +9769,7 @@ function validateQualificationBundleManifest(value) {
9677
9769
  const candidate = object3(subject.shaderManifestCore, "qualification.subject.shaderManifestCore");
9678
9770
  exact2(candidate, ["shaderId", "version", "sha256"], "qualification.subject.shaderManifestCore");
9679
9771
  token2(candidate.shaderId, "qualification.subject.shaderManifestCore.shaderId");
9680
- token2(candidate.version, "qualification.subject.shaderManifestCore.version");
9772
+ immutableVersion3(candidate.version, "qualification.subject.shaderManifestCore.version");
9681
9773
  sha(candidate.sha256, "qualification.subject.shaderManifestCore.sha256");
9682
9774
  path(bundle.shaderManifestCorePath, "qualification.shaderManifestCorePath", [".json"]);
9683
9775
  const interfaceManifest = object3(bundle.gpuInterfaceManifest, "qualification.gpuInterfaceManifest");
@@ -9737,7 +9829,7 @@ function validateQualificationBundleManifest(value) {
9737
9829
  const expectedUnits = [...inventory.value.compileUnits.map((unit) => unit.compileUnitId)].sort();
9738
9830
  if (unitIds.join("\n") !== expectedUnits.join("\n")) throw new TypeError("Subject compile-unit IDs differ from inventory.");
9739
9831
  orderedUniqueTokens(subject.requiredCellIds, "qualification.subject.requiredCellIds");
9740
- return { ok: true, value: bundle };
9832
+ return { ok: true, value: freezeJson2(bundle) };
9741
9833
  } catch (cause) {
9742
9834
  return { ok: false, diagnostics: [{ code: "invalid-contract", severity: "error", message: cause instanceof Error ? cause.message : "Invalid qualification bundle." }] };
9743
9835
  }