vestige/apps
Sam Valladares 85650f02fd fix(dashboard): backdrop lifecycle races + GPU buffer leaks (Kimi-audited)
Kimi K2.7-code audit (max-thinking) found a CRITICAL race + leaks that Claude's
shallower pass missed; all verified and fixed:
- CRITICAL: late WebGPU boot after the 6s watchdog fired bootFallback() would
  set mode='webgpu' and start a SECOND rAF loop, orphaning the fallback loop.
  Fixed with a top-of-function + post-await abort guard in tryBootWebgpu and a
  single idempotent tick()/startLoop() dispatcher (running flag) — rAF for the
  draw loop is now scheduled in EXACTLY one place.
- GPU buffer leaks: partBuf/uBuf are now destroyed via releaseBuffers() on every
  early-exit, the catch path, and the device-lost handler (was leaked everywhere
  except the handle!=null onDestroy path).
- resize() now reconfigures the WebGPU context (was stretching after resize).
- drawWebgpu wrapped in try/catch -> bootFallback (one bad frame no longer kills
  the field permanently).
- fallback now honors the intensity prop + is frame-rate independent (dt*60);
  onVisibility resets fbLastT; onDestroy SSR-guard ordering.

svelte-check 0 errors / 967 files. Memory Cinema / Graph3D untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 14:24:10 -05:00
..
dashboard fix(dashboard): backdrop lifecycle races + GPU buffer leaks (Kimi-audited) 2026-06-27 14:24:10 -05:00