WebGPU WGSL Compute Pipelines, Instanced Candlestick Vertex Pulling & Sub-8.33ms 120Hz Frame Pacing
Sustaining 120 frames per second (8.33 milliseconds total CPU + GPU budget per frame) across 86,400 daily 1-second candles, 20-level orderbook heatmaps, and 18 indicator overlays requires moving geometry expansion off the JavaScript heap and into persistent GPU storage buffers.
1. 32-Byte Aligned Ring Buffers & Programmable Vertex Pulling
Instead of rebuilding a 6-float-per-vertex CPU Float32Array on every zoom or pan event, each OHLCV bar occupies one 32-byte aligned GPU struct inside a ring-indexed var<storage, read> buffer, and a single instanced draw call (draw(12, visible_bar_count): 6 body vertices + 6 wick vertices) synthesizes screen-space quads on the fly:
struct CandleBar {
ts_sec : u32, pad0 : u32,
open : f32, high : f32,
low : f32, close : f32,
volume : f32, vwap : f32,
}; // 32 bytes exact cache-line / std430 stride
// Live 1s WebSocket tick update transfers 32 bytes (not megabytes of tessellated triangles):
device.queue.writeBuffer(candleStorageBuf, (ringHead % MAX_BARS) * 32, tickBytes32);2. Tree-Structured Shared-Memory Min/Max Viewport Reduction
Computing exact visible price bounds in parallel inside var<workgroup> shared SRAM avoids GPU-to-CPU readback stalls during inertial trackpad scrolling:
// @compute @workgroup_size(256)
for (var stride: u32 = 128u; stride > 0u; stride = stride >> 1u) {
workgroupBarrier();
if (local_id.x < stride) {
shared_low[local_id.x] = min(shared_low[local_id.x], shared_low[local_id.x + stride]);
shared_high[local_id.x] = max(shared_high[local_id.x], shared_high[local_id.x + stride]);
}
}3. Physical Device-Pixel Snapping & Zero-GC Render Loops
Pre-allocating typed command uniforms eliminates V8 garbage-collection pauses inside requestAnimationFrame, while snapping bar centers via x_dev = floor(x_norm * width_px) + 0.5 keeps single-pixel wicks razor-sharp across 2x MacBook Pro Liquid Retina XDR and 3x iPhone OLED viewports.
4. Sub-Second Charting SaaS vs Destiny Consolidation Calculator
Compare $59.95–$209.95/month sub-minute charting subscriptions against $0 Free 120Hz 1-second WebGPU Supercharts at /trade and $14.99/mo Web Cloud Pass.
Cite reproducible Apple M4 Pro Unified Memory benchmark receipts in engineering repositories.
WebGPU WGSL Pipelines & 120Hz Candlestick Pacing — FAQ
Direct answers on 32-byte storage-buffer vertex pulling, 256-thread WGSL reductions, Retina pixel snapping, and WebGL2/Canvas2D fallback.
- Why does programmable storage-buffer vertex pulling outperform Canvas2D or CPU triangle tessellation for 100,000+ candles?
- Immediate-mode Canvas2D fillRect/stroke loops run single-threaded on the JavaScript main thread and drop below 30 fps past a few thousand bars. With WebGPU storage-buffer vertex pulling, raw 32-byte OHLCV structs reside in persistent GPU VRAM; appending a new 1-second tick issues a single 32-byte queue.writeBuffer offset update while the vertex shader expands 12 quad vertices per visible bar (6 body + 6 wick) in parallel across GPU cores.
- How does parallel WGSL workgroup reduction compute Y-axis auto-scale bounds without stalling the CPU?
- Panning across 50,000 historical 1-second candles requires finding min(low) and max(high) over the visible index slice [i_start, i_end]. A 256-thread WGSL compute shader reduces visible highs and lows in shared workgroup<f32> memory in log2(256) = 8 barrier steps so the vertex stage normalizes Y coordinates directly on the GPU.
- How does Destiny maintain crisp sub-pixel 1px wicks on Retina / HiDPI displays without shimmering?
- Candlestick centers snap to device-pixel half-integer centers (floor(x_px) + 0.5) in physical framebuffer coordinates scaled by devicePixelRatio, preventing 1-device-pixel wicks from straddling two columns and flickering during 120Hz horizontal pan gestures.
- What happens on older browsers or Linux configurations where WebGPU is disabled?
- Destiny Trader automatically falls back from WebGPU to instanced WebGL2 vertex arrays and high-DPI Canvas2D while preserving full 1-second WebSocket streaming and SIMD128 indicator parity.