@plasius/gpu-shader 0.1.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.
@@ -0,0 +1,50 @@
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';
2
+
3
+ /** Reflects final assembled WGSL; selectors can identify data but never supply layout numbers. */
4
+ declare function reflectGpuInterface(input: ReflectGpuInterfaceInput): Promise<GpuInterfaceManifest>;
5
+
6
+ /** Regenerates the final interface and rejects stale claims or model projections. */
7
+ declare function validateAssembledGpuInterface(input: {
8
+ readonly assembled: ReflectGpuInterfaceInput;
9
+ readonly expectedModelInterface?: GpuInterfaceManifest;
10
+ readonly claimedManifest?: GpuInterfaceManifest;
11
+ }): Promise<ShaderResult<GpuInterfaceManifest>>;
12
+
13
+ /** Produces deterministic generated source without writing files itself. */
14
+ declare function generateGpuInterfaceArtifacts(manifest: GpuInterfaceManifest): GeneratedGpuInterfaceArtifacts;
15
+
16
+ interface AdmittedQualificationBundle {
17
+ readonly root: string;
18
+ readonly manifest: ShaderQualificationBundleManifest;
19
+ readonly shaderManifestCore: ShaderVersionManifestCore;
20
+ readonly fixtures: ReadonlyMap<string, ShaderQualificationFixtureManifest>;
21
+ readonly gpuInterface: GpuInterfaceManifest;
22
+ readonly modelFixtures: ReadonlyMap<string, ModelGpuCompatibilityDescriptor>;
23
+ readonly fileBytes: ReadonlyMap<string, Uint8Array>;
24
+ }
25
+ /** Recomputes the data-only closure, final-WGSL reflection, ABI hashes, fixtures, assembly, and core digest. */
26
+ declare function admitQualificationBundle(directory: string): Promise<AdmittedQualificationBundle>;
27
+
28
+ type AstNode = any;
29
+ interface SourceBinding {
30
+ readonly moduleId: string;
31
+ readonly variableName: string;
32
+ readonly group: number;
33
+ readonly binding: number;
34
+ readonly resource: GpuBindingResourceLayout;
35
+ }
36
+ interface WgslSourceAnalysis {
37
+ readonly ast: readonly AstNode[];
38
+ readonly records: readonly GpuRecordLayout[];
39
+ readonly bindings: readonly SourceBinding[];
40
+ readonly overrides: readonly GpuOverrideLayout[];
41
+ readonly workgroupSizes: ReadonlyMap<string, readonly [GpuWorkgroupDimension, GpuWorkgroupDimension, GpuWorkgroupDimension]>;
42
+ /** WebGPU workgroup-storage bytes statically used by each compute entry point. */
43
+ readonly workgroupStorageSizes: ReadonlyMap<string, number>;
44
+ }
45
+ /** Detects disagreement between the independent AST layout and reflector metadata. */
46
+ declare function assertReflectedRecordLayouts(sourceRecords: readonly GpuRecordLayout[], reflectedRecords: readonly GpuRecordLayout[]): void;
47
+ /** Derives host-shareable layout independently from wgsl_reflect's layout metadata. */
48
+ declare function analyzeWgslSource(source: string, moduleId: string): WgslSourceAnalysis;
49
+
50
+ export { type AdmittedQualificationBundle, GeneratedGpuInterfaceArtifacts, ReflectGpuInterfaceInput, admitQualificationBundle, analyzeWgslSource, assertReflectedRecordLayouts, generateGpuInterfaceArtifacts, reflectGpuInterface, validateAssembledGpuInterface };
package/dist/node.d.ts ADDED
@@ -0,0 +1,50 @@
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';
2
+
3
+ /** Reflects final assembled WGSL; selectors can identify data but never supply layout numbers. */
4
+ declare function reflectGpuInterface(input: ReflectGpuInterfaceInput): Promise<GpuInterfaceManifest>;
5
+
6
+ /** Regenerates the final interface and rejects stale claims or model projections. */
7
+ declare function validateAssembledGpuInterface(input: {
8
+ readonly assembled: ReflectGpuInterfaceInput;
9
+ readonly expectedModelInterface?: GpuInterfaceManifest;
10
+ readonly claimedManifest?: GpuInterfaceManifest;
11
+ }): Promise<ShaderResult<GpuInterfaceManifest>>;
12
+
13
+ /** Produces deterministic generated source without writing files itself. */
14
+ declare function generateGpuInterfaceArtifacts(manifest: GpuInterfaceManifest): GeneratedGpuInterfaceArtifacts;
15
+
16
+ interface AdmittedQualificationBundle {
17
+ readonly root: string;
18
+ readonly manifest: ShaderQualificationBundleManifest;
19
+ readonly shaderManifestCore: ShaderVersionManifestCore;
20
+ readonly fixtures: ReadonlyMap<string, ShaderQualificationFixtureManifest>;
21
+ readonly gpuInterface: GpuInterfaceManifest;
22
+ readonly modelFixtures: ReadonlyMap<string, ModelGpuCompatibilityDescriptor>;
23
+ readonly fileBytes: ReadonlyMap<string, Uint8Array>;
24
+ }
25
+ /** Recomputes the data-only closure, final-WGSL reflection, ABI hashes, fixtures, assembly, and core digest. */
26
+ declare function admitQualificationBundle(directory: string): Promise<AdmittedQualificationBundle>;
27
+
28
+ type AstNode = any;
29
+ interface SourceBinding {
30
+ readonly moduleId: string;
31
+ readonly variableName: string;
32
+ readonly group: number;
33
+ readonly binding: number;
34
+ readonly resource: GpuBindingResourceLayout;
35
+ }
36
+ interface WgslSourceAnalysis {
37
+ readonly ast: readonly AstNode[];
38
+ readonly records: readonly GpuRecordLayout[];
39
+ readonly bindings: readonly SourceBinding[];
40
+ readonly overrides: readonly GpuOverrideLayout[];
41
+ readonly workgroupSizes: ReadonlyMap<string, readonly [GpuWorkgroupDimension, GpuWorkgroupDimension, GpuWorkgroupDimension]>;
42
+ /** WebGPU workgroup-storage bytes statically used by each compute entry point. */
43
+ readonly workgroupStorageSizes: ReadonlyMap<string, number>;
44
+ }
45
+ /** Detects disagreement between the independent AST layout and reflector metadata. */
46
+ declare function assertReflectedRecordLayouts(sourceRecords: readonly GpuRecordLayout[], reflectedRecords: readonly GpuRecordLayout[]): void;
47
+ /** Derives host-shareable layout independently from wgsl_reflect's layout metadata. */
48
+ declare function analyzeWgslSource(source: string, moduleId: string): WgslSourceAnalysis;
49
+
50
+ export { type AdmittedQualificationBundle, GeneratedGpuInterfaceArtifacts, ReflectGpuInterfaceInput, admitQualificationBundle, analyzeWgslSource, assertReflectedRecordLayouts, generateGpuInterfaceArtifacts, reflectGpuInterface, validateAssembledGpuInterface };