Skip to content

fix: enforce WebGPU gate, handle WASM OOM and assertion failures#5

Merged
Jesssullivan merged 1 commit intomasterfrom
fix/webgpu-gate-and-oom
Feb 12, 2026
Merged

fix: enforce WebGPU gate, handle WASM OOM and assertion failures#5
Jesssullivan merged 1 commit intomasterfrom
fix/webgpu-gate-and-oom

Conversation

@Jesssullivan
Copy link
Owner

Summary

  • Non-WebGPU browsers are now blocked by a non-dismissable onboarding modal with browser-specific instructions on enabling WebGPU
  • WASM OOM (Aborted(OOM)) errors null the unrecoverable Emscripten context and fall through to JS fallback
  • Futhark WebGPU $futhark_context_new assertion failures produce clearer error messages about GPU driver incompatibility
  • Defense-in-depth: demo routes have both a root-layout gate modal and an inline block overlay

Changes

  • consentStorage.tswebgpuAvailable field, shouldBlockDemos(), updateWebGPUAvailability()
  • OnboardingModal.sveltegated derived state disables close/escape/backdrop/finish
  • demo/+layout.svelte — inline WebGPU gate with spinner/block/pass states
  • +layout.svelte$effect re-shows gate modal on /demo/* navigation
  • ComputeDispatcher.ts — OOM catch nulls futharkContext in both computeEsdtFuthark() and runFullPipeline()
  • futhark-webgpu/index.ts — detect assertion/abort errors in newFutharkWebGPUContext()
  • 14 new tests across 3 files (gate enforcement, OOM handling, assertion fallback)

Test plan

  • pnpm test passes (766 pass, 26 skipped)
  • Browser with WebGPU: modal dismissable, demos work normally
  • Browser without WebGPU (--disable-gpu): modal blocks, demo routes show gate overlay
  • Verify on https://pixelwise.ephemera.xoxd.ai after deploy

Non-WebGPU browsers are now blocked by a non-dismissable onboarding
modal with browser-specific instructions. WASM OOM errors null the
unrecoverable Emscripten context and fall through to JS fallback.
Futhark WebGPU assertion failures produce clearer error messages.

- consentStorage: add webgpuAvailable field, shouldBlockDemos()
- OnboardingModal: gated state disables close/escape/backdrop/finish
- demo/+layout: second gate layer with inline block + spinner
- ComputeDispatcher: OOM catch nulls futharkContext
- futhark-webgpu: detect assertion/abort in context creation
- 14 new tests (gate enforcement, OOM handling, assertion fallback)
@Jesssullivan Jesssullivan merged commit dd7c6bb into master Feb 12, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant