You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(shaders): detect stale WGSL twins by hashing the authored GLSL
A generated WGSL twin was only ever (re)generated when MISSING — edit the
GLSL and the committed/generated twin silently went stale, so WebGPU kept
rendering the old shader and CI --check (presence-only) waved it through.
That undermined the contract that GLSL is the single source and the WGSL
twin is a derivative.
Make the derivation verifiable: each generated `wgsl full` twin now stores
`// source-hash: <hash>` of the authored GLSL (everything but the generated
sections, trimmed so generate→check round-trips exactly). needsTwin()/
sourceHash() are exported, pure and engine-free, so one definition of "stale"
is shared by:
- the CLI + CI --check (a stale or hash-less twin now reports would-generate),
- the editor's on-open generation (regenerates stale twins, not just missing).
Hand-authored `wgsl` twins (builtins) and `#pragma switch` shaders are left
alone. All committed generated twins gain their source-hash (WGSL bytes
unchanged — deterministic; +2 lines each). Extends the CI twin guard from
presence to freshness.
Verified: unit tests for the missing/fresh/stale/legacy/hand-authored/switch/
twin-edit-vs-glsl-edit cases; editing a shader's GLSL then opening it under
ESTELLA_SHOT_BACKEND=webgpu logs "generated 1 WGSL twin(s) on open" (the
editor now regenerates the stale twin). 3612 SDK tests green.
0 commit comments