Skip to content

ADR 001: WebGPU Renderer Strategy

Status: Accepted (Phase 2 complete — v1.17)
Date: 2026-07-05
Stage: 01-render-engine-performance (tasks 1.1–1.3, 1.2)

Context

ChartOptions.renderer accepts "webgl" | "webgpu". Experimental code existed in src/gpu/ but was not wired as the chart renderer.

Decision

  1. renderer: "webgl" (default) — NativeWebGLRenderer.
  2. renderer: "webgpu"GpuChartRenderer with WebGPU backend; WebGL2 fallback if unavailable.
  3. PluginGpu — GPU compute experiments outside the chart loop.

Implementation (v1.17)

ComponentPath
Chart adaptersrc/renderer/GpuChartRenderer.ts
GPU facadesrc/gpu/adapter/gpuRenderer.tsrenderNativeSeries()
WebGPU trianglesWebGPUBackend.renderSolidTriangles() — uniform-color bars/boxes
Benchmarksline-200k-webgl / line-200k-webgpu + evaluateRendererCompare()

Chart WebGPU parity

SeriesWebGPU
line, scatter, step, band, bar, heatmap
candlestick✅ (bullish/bearish triangles)
boxplot✅ (faces + whiskers)
waterfall✅ (pos/neg/subtotal bars + connectors)
polar, gauge, sankeyWebGL-only

Revisit criteria

  • [x] Line + candlestick parity
  • [x] Boxplot + waterfall parity
  • [x] No warning when WebGPU init succeeds
  • [x] Fallback when navigator.gpu unavailable
  • [ ] Benchmark ≥ WebGL FPS on discrete GPU (CI smoke only; desktop verify locally)
  • [ ] Plot-area scissor + plotAreaBackground on WebGPU path

Released under the MIT License.