/** * Capsule declaration locking the {@link GLSLCompiler.compile} contract as a * standing `pureTransform` over a SEEDED Boundary + per-state value domain. * * WHY `pureTransform`: `compile` is a pure function of (boundary, states) — no * receipt byte law, no async hashing, no mutate channel. The schema-derived * property harness fits the value-level laws exactly. * * WHY THE INPUT IS SEED MATERIAL (not a raw `Boundary` + `Record` map): the * arbitrary-from-schema walker supports String / Number / Array / Tuple / Struct * but THROWS on index signatures (`Schema.Record`), so a per-state * `Record` cannot be schema-arbitrary-minted, and a raw * `Boundary` carries a content-addressed `id` the walker can't forge. So the * input schema generates a small, fully-supported SEED domain — state-name and * field-name lists plus a value MATRIX — and `run` builds a real, valid * `Boundary` (deduped names, strictly-ascending thresholds) and zips the matrix * into the per-state value maps `GLSLCompiler.compile` consumes. The invariants * then assert over the REAL compile output, never a weakened stand-in. * * THE COMPLETENESS LAW (invariant c) is the regression guard for the * omitted-uniform-reset fix: WebGL uniforms persist across draws, so a uniform * authored in only some states must be explicitly RESET (0) where omitted — * `stateUniforms[state]` must therefore carry EVERY authored uniform name for * EVERY state. The seed deliberately exercises ragged per-state field coverage * (a state row shorter than the field list omits the tail), so the property test * regularly hits the omitted-uniform case the unit test pins by hand. * * @module */ import { Schema } from 'effect'; import { Boundary } from '@czap/core'; /** * Seed material the schema-arbitrary CAN produce (String / Number / Array are * fully supported AST nodes). `run` normalizes it into a valid Boundary + the * per-state value maps. */ declare const GLSLCompileSeed: Schema.Struct<{ /** Candidate state names → deduped, ascending-thresholded boundary states. */ readonly states: Schema.$Array; /** Candidate field names → deduped authored uniform key set. */ readonly fields: Schema.$Array; /** * Value matrix `values[stateIdx][fieldIdx]`. A row shorter than `fields` * omits that state's trailing fields (ragged coverage → exercises the * omitted-uniform-reset completeness law). All values are integers (the * Number arbitrary mints `fc.integer()`), so the int-type law holds. */ readonly values: Schema.$Array>; }>; type GLSLCompileSeedValue = Schema.Schema.Type; /** Per-state value maps in the shape `GLSLCompiler.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, valid Boundary plus the per-state value maps. * Dedups state names (so thresholds stay strictly ascending without collision), * caps the domain to keep the budget honest, and zips the value matrix into * `{ [state]: { [field]: number } }`. A missing matrix cell (ragged row) simply * omits that field for that state — the very condition the completeness law * guards. */ declare function buildInputs(seed: GLSLCompileSeedValue): { boundary: Boundary.Shape; states: StateMaps; stateNames: string[]; fieldNames: string[]; }; /** * Declared capsule for the GLSL compiler. Registered at import time; walked by * the factory compiler. The generated property test feeds schema-seeds, `run` * builds a real Boundary + state maps and calls `GLSLCompiler.compile`, and the * invariants assert the u_state / determinism / per-state-completeness / * int-type LAWS over the REAL compile output. */ export declare const glslCompileCapsule: 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 _glslCompileInternals: { readonly buildInputs: typeof buildInputs; readonly makeBoundary: typeof makeBoundary; }; export {}; //# sourceMappingURL=glsl-compile.d.ts.map