/** * Capsule declaration locking the {@link WGSLCompiler.compile} contract as a * standing `pureTransform` over a SEEDED Boundary + per-state value domain — the * WGSL mirror of `glsl-compile.ts`. * * WHY `pureTransform` / WHY SEED MATERIAL: identical to the GLSL arm — `compile` * is pure over (boundary, states), and the arbitrary-from-schema walker cannot * mint a per-state `Record` (index signatures throw) nor a content-addressed * `Boundary` id. So the input is a state-name + field-name + value-matrix seed * `run` normalizes into a real Boundary + the per-state value maps the compiler * consumes; the invariants assert over the REAL compile output. * * THE PER-STATE `stateBindings` LAW (invariant c) is the GLSL-mirror * isomorphism: the WGSL compiler must expose each state's AUTHORED field values * via `stateBindings[state]`, not just the merged last-state default — the WGSL * analog of GLSL's `stateUniforms`, carried end-to-end so a crossing resolves * `stateBindings[currentState]`. (Unlike GLSL, WGSL does NOT pad omitted fields * to 0 — the per-snapshot buffer clear handles resets — so the law is exact-set * equality with the AUTHORED keys, not completion to 0.) * * @module */ import { Schema } from 'effect'; import { Boundary } from '@czap/core'; /** Seed material the schema-arbitrary CAN produce. `run` normalizes it. */ declare const WGSLCompileSeed: Schema.Struct<{ /** Candidate state names → deduped, ascending-thresholded boundary states. */ readonly states: Schema.$Array; /** Candidate field names → deduped authored struct-field key set. */ readonly fields: Schema.$Array; /** Value matrix `values[stateIdx][fieldIdx]`; a short row omits the tail. */ readonly values: Schema.$Array>; }>; type WGSLCompileSeedValue = Schema.Schema.Type; /** Per-state value maps in the shape `WGSLCompiler.compile` consumes. */ type StateMaps = { [s: string]: Record; }; /** Build a valid Boundary from a recorded (deduped) state-name list. */ declare function makeBoundary(stateNames: readonly string[]): Boundary.Shape; /** Normalize a seed into a real Boundary + per-state value maps (see glsl-compile.ts). */ declare function buildInputs(seed: WGSLCompileSeedValue): { boundary: Boundary.Shape; states: StateMaps; stateNames: string[]; fieldNames: string[]; }; /** * Declared capsule for the WGSL compiler. The generated property test feeds * schema-seeds; `run` builds a real Boundary + state maps and calls * `WGSLCompiler.compile`; the invariants assert the state_index / determinism / * per-state-stateBindings / type-promotion LAWS over the REAL compile output. */ export declare const wgslCompileCapsule: import("@czap/core").CapsuleDef<"pureTransform", { readonly values: readonly (readonly number[])[]; readonly states: readonly string[]; readonly fields: readonly string[]; }, unknown, unknown>; /** Internal helpers exported for direct unit assertions over the seed→inputs builder. */ export declare const _wgslCompileInternals: { readonly buildInputs: typeof buildInputs; readonly makeBoundary: typeof makeBoundary; }; export {}; //# sourceMappingURL=wgsl-compile.d.ts.map