export declare const SELFTEST_VS = "@vertex fn vs(@builtin(vertex_index) i: u32) -> @builtin(position) vec4 { return vec4(f32(i) - 1.0, 0.0, 0.0, 1.0); }"; /** Control: a plain component read. */ export declare const SELFTEST_FS_CONTROL = "struct O { @location(0) c: vec4 };\nvar v : vec4;\n@fragment fn main() -> O { var o: O; o.c = vec4(v.x); return o; }"; /** Repro: a component read off a swizzle — what three r185 emits for every lit node material. */ export declare const SELFTEST_FS_SWIZZLE = "struct O { @location(0) c: vec4 };\nvar v : vec4;\n@fragment fn main() -> O { var o: O; o.c = vec4(v.xy.x); return o; }"; export interface ShaderCompileResult { ok: boolean; messages: string[]; } export interface WebGpuSelfTest { /** `available` = an adapter and a device; `none` = no navigator.gpu or no adapter; `error` = the probe itself threw. */ webgpu: 'available' | 'none' | 'error'; adapter?: string | null; reason?: string; control?: ShaderCompileResult; swizzle?: ShaderCompileResult; ms?: number; } /** Page-side probe. A plain function (serialised by Playwright); takes the shader sources as its argument. */ export declare function webGpuSelfTestProbe(src: { vs: string; control: string; swizzle: string; }): Promise; export declare const SELFTEST_SOURCES: { vs: string; control: string; swizzle: string; }; export interface SelfTestBrowserLabel { name: string; version: string | null; executablePath?: string | null; } export type SelfTestDecision = { ok: true; note?: string; } | { ok: false; error: string; }; /** Message prefix the hosted worker / reviewers can match on. */ export declare const BROKEN_COMPILER_PREFIX = "broken WebGPU shader compiler in"; /** * Decide whether a browser may render. Pure, so the policy is unit-tested: * - repro fails while the control compiles → the known Tint swizzle bug: refuse. * - control fails too → WebGPU cannot compile a trivial shader: refuse. * - no adapter / probe threw → refuse when the route needs WebGPU, else allow (and the caller records it). */ export declare function decideSelfTest(r: WebGpuSelfTest | null | undefined, browser: SelfTestBrowserLabel, opts: { requireWebGpu: boolean; }): SelfTestDecision;