export interface VariantMetadata { /** False only when the algorithm supports arbitrary positive workgroup dimensions. Omission preserves legacy power-of-two validation. */ workgroupPowerOfTwo?: boolean; /** Resolved pipeline constants controlling workgroup X/Y/Z; null keeps the static registry axis. */ workgroupConstants?: readonly [string | null, string | null, string | null]; /** Dynamic workgroup arrays in bytes per invocation, added to resolved static sharedMemory bytes. */ workgroupStorageBytesPerInvocation?: number; pairedMechanismKernels?: readonly { operation: string; variant: string }[]; mechanismKernels?: readonly { operation: string; variant: string }[]; colsPerWg?: number; tileM?: number; outputBinding?: number; maxKVLen?: number; subgroupPartitionLanes?: number; headKDim?: number; maxHeadVDim?: number; stateComponents?: number; valueSliceWidth?: number; normGateVariant?: string; convVariant?: string; parallelConvVariant?: string; fusedFfnDefaults?: Readonly>; /** Gate activation applied by a gated-delta kernel's gated RMSNorm; guarded against the manifest. */ normGateActivation?: 'silu' | 'sigmoid'; [key: string]: unknown; } import type { BindingSchema, UniformsSchema } from "./schema/execution/kernel-registry.schema.js"; export type DeepReadonly = T extends (...args: never[]) => unknown ? T : T extends readonly unknown[] ? { readonly [K in keyof T]: DeepReadonly } : T extends object ? { readonly [K in keyof T]: DeepReadonly } : T; export interface KernelConfig { readonly operation: string; readonly variant: string; readonly shaderFile: string; readonly entryPoint: string; readonly immediateCompletion: 'submitted' | 'settled'; readonly workgroupSize: readonly [number, number, number]; readonly requires: readonly string[]; readonly requiredWgslFeatures: readonly string[]; readonly bindings: readonly DeepReadonly[]; readonly uniforms: DeepReadonly | null; readonly wgslOverrides?: DeepReadonly>; readonly sharedMemory?: number; /** Raw shader output; composed wrappers may apply declared subsequent stages. */ readonly outputDtype?: 'f16' | 'f32' | 'i32'; readonly weightDtype?: string; readonly variantMetadata?: DeepReadonly; } export const KERNEL_CONFIGS: Readonly>>>; export function getKernelConfig(operation: string, variant: string): KernelConfig; export interface KernelValidationContext { readonly operation: string; readonly variant: string; readonly bindings: readonly unknown[]; readonly uniforms: Readonly>; readonly workgroups: number | readonly number[] | Readonly<{ indirectBuffer: GPUBuffer; indirectOffset?: number }>; readonly constants: Readonly> | null; readonly extraBindings: readonly unknown[] | null; } export interface KernelValidator { readonly id: string; readonly validate: (context: KernelValidationContext) => void; } export interface KernelRegistry { readonly identity: string; readonly configs: Readonly>>>; readonly validators: Readonly>>>; getKernelConfig(operation: string, variant: string): KernelConfig; getKernelValidator(operation: string, variant: string): KernelValidator['validate'] | null; } export interface KernelRegistryOptions { extensions?: Record>; validators?: Record>; } export declare function createKernelRegistry(options?: KernelRegistryOptions): KernelRegistry; export declare const DEFAULT_KERNEL_REGISTRY: KernelRegistry; export declare function isKernelRegistry(value: unknown): value is KernelRegistry; export declare function getActiveKernelRegistry(): KernelRegistry | null; export declare function enterKernelRegistry(registry: KernelRegistry): () => void; export declare function getKernelConfigs(): KernelRegistry['configs']; export declare function getKernelRegistryIdentity(): string;