Skip to content

feat(gpu): surface silent GPU-operator init failures (ADR-0019) - #337

Open
jeffcrouse wants to merge 1 commit into
mainfrom
fix-gpu-op-error-surfacing
Open

feat(gpu): surface silent GPU-operator init failures (ADR-0019)#337
jeffcrouse wants to merge 1 commit into
mainfrom
fix-gpu-op-error-surfacing

Conversation

@jeffcrouse

Copy link
Copy Markdown
Member

Summary

A GPU op whose shader/pipeline failed to initialize did if (!pipe_) return; — a black frame with no log, toast, health signal, or node badge, and never retried. You couldn't tell a broken shader from a routing problem (this cost hours in the grid reactive-visuals session).

Fix

Reuse the already-wired per-node error channel (vivid_report_gpu_errorVisualNode::runtime_error → node badge) and make it loud + observable:

  • gpu_common.h: report_if_no_pipeline(c, pipe, err) (ops call it in the pipeline guard so a failed init reports the concise WGSL error every frame it's down) + concise_gpu_error().
  • Swept 14 GPU ops onto it (cosine_palette, time_machine, solids, emitter, instancer, feedback, bloom, mesh, note_type, text, vectortext, gradient, step_bars, blit). The 6 ops that already reported are unchanged and get the promotion for free.
  • frame.cpp promote_operator_errors: edge-trigger a new runtime_error to VLOG_ERR → auto-toast + header dot (mirrors the ADR-0016 shader-file path).
  • Health: errored_ops in the snapshot + get_health JSON, Warning severity (not Error — the channel also carries soft notices like Render3D's light-ceiling).

Verification

A project op with intentionally-broken WGSL now yields get_health.errored_ops=1 + a promoted operator 'X' error: <concise msg> (was: silent black). Full ctest 99/99; test_runtime_health covers the new errored_ops severity + JSON.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QB6eSNJE55ru3g4vsL77GT

A GPU op whose shader/pipeline failed to initialize did `if (!pipe_) return;` —
a black frame with NO log, toast, health signal, or node badge, and no way to
tell a broken shader from a routing problem. (This cost hours in the grid
reactive-visuals session: a custom op rendered pure black with zero feedback.)

Reuse the already-wired per-node error channel (vivid_report_gpu_error →
VisualNode::runtime_error → node badge) and make it loud + observable:

- gpu_common.h: `report_if_no_pipeline(c, pipe, err)` — ops call it in the
  pipeline guard so a failed init reports the concise WGSL error EVERY frame it
  is down (the runtime value-inits ctx per frame; a one-shot report flickers).
  Plus `concise_gpu_error()` to reduce a wgpu validation dump to one line.
- Sweep 14 GPU ops onto it (cosine_palette, time_machine, solids, emitter,
  instancer, feedback, bloom, mesh, note_type, text, vectortext, gradient,
  step_bars, blit_op). Ops with two pipelines (mesh/note_type/vectortext) report
  inline. The 6 ops that already reported (switch/image/video/mesh_render/
  mesh_displace/model) are unchanged and now get the promotion for free.
- frame.cpp `promote_operator_errors`: edge-trigger a node's new runtime_error
  to VLOG_ERR (→ auto-toast + header dot, mirroring the ADR-0016 shader-file
  path). Without this a broken op only showed a node badge — invisible headless.
- runtime health: `errored_ops` count in the snapshot + get_health JSON;
  severity WARNING (not Error) since the channel also carries soft notices like
  Render3D's light-ceiling — it must not red-alert a whole session.

Verified: a project op with intentionally-broken WGSL now yields
get_health.errored_ops=1 + a promoted "operator 'X' error: <concise msg>" log
(was: silent black). Full ctest 99/99; test_runtime_health covers the new
errored_ops severity + JSON.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QB6eSNJE55ru3g4vsL77GT
@github-actions

Copy link
Copy Markdown
Contributor

Production gate (core): ✅ PASS

  • 82/82 tests passed (0 failed) in 15.293s

@jeffcrouse
jeffcrouse enabled auto-merge (squash) August 11, 2026 14:00
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