From webgpu-inspector
Interprets WebGPU Inspector frame captures including GPU object graphs, command lists, render/compute passes, buffers, textures, shaders, and validation errors. Useful when analyzing captured .json files from WebGPU Inspector MCP tools or DevTools.
How this skill is triggered — by the user, by Claude, or both
Slash command
/webgpu-inspector:webgpu-capture-analysisThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A WebGPU Inspector capture is a JSON record of one or more rendered frames: the
A WebGPU Inspector capture is a JSON record of one or more rendered frames: the full GPU object graph plus the ordered list of WebGPU API calls. This skill explains how to read one and what to flag.
objects — map of numeric id to a record: { id, type, label, descriptor, stacktrace, ... }. Types: Adapter, Device, Buffer, Texture,
TextureView, Sampler, BindGroup, BindGroupLayout, PipelineLayout,
RenderPipeline, ComputePipeline, ShaderModule, RenderBundle.commands — ordered array of { index, method, object, args, result, ... }.
object is the GPU object the method was called on; args are its
arguments. References to GPU objects appear as { "__id": N, "__class": ..., "__label": ... }.validationErrors — WebGPU validation errors raised during the capture.__base64Omitted markers and byte lengths instead of bytes.Always start with get_capture_summary — it carries object/command counts,
derived stats, and a heuristic issues list. Then drill in:
get_commands with a method filter, a passLabel regex, or an
offset/limit window — never fetch the whole list at once for a large capture.get_object for a pipeline, bind group, or texture descriptor.get_shader for a ShaderModule's WGSL.get_validation_errors for correctness problems.To debug a specific draw (e.g. "this draw read a vertex attribute as 0"):
get_draw_state(commandIndex) resolves the bound pipeline (+ vertex layout),
bind groups, vertex/index buffers, and draw params for a draw command. Each
vertex buffer reports a bufferDataCommandIndex.decode_vertex_buffer(commandIndex) — pass a vertex buffer's
bufferDataCommandIndex to decode its first N vertices into per-attribute
numbers (the layout is taken from the pipeline automatically).diff_draws(cmdA, cmdB) compares a working vs. a broken draw's resolved state.For very large frames, capture only what you need: capture_frames accepts
passLabel / passType (capture heavy payloads for matching passes only) and
maxBufferSize (per-buffer byte cap; truncated buffers are marked). To inspect a
live buffer without a full capture, use read_buffer.
Cite index (command) and id (object) values in findings so the user can
locate them in the WebGPU Inspector DevTools Capture panel.
Correctness
validationErrors — always report these first; they are real bugs.Per-frame cost / hitching
createRenderPipeline / createComputePipeline inside the captured frame —
pipeline creation is expensive; move it to load time.createShaderModule inside the frame — same idea.writeBuffer / writeTexture calls every frame — consider
persistent buffers, mapped writes, or uploading less.CPU submission overhead
setPipeline / setBindGroup / setVertexBuffer counts relative to
draw calls — sort draws by pipeline and bind group to cut state changes.setPipeline / setBindGroup (the summary flags
these) — the bind is a no-op and can be skipped.Pass structure
beginRenderPass calls — each pass has fixed cost; merge where the
attachments allow.loadOp: "load" where "clear" would do (forces an attachment read), or
storeOp: "store" on attachments whose result is never used.Shaders (via get_shader)
Give a prioritized list. For each finding: severity (error > warning > info), a one-line description, why it matters for this capture, and a concrete fix. Reference command indices and object ids. Distinguish confirmed bugs (validation errors) from heuristics (a flagged pattern that may be intentional) — say which is which rather than overstating.
npx claudepluginhub brendan-duncan/webgpu_inspector --plugin webgpu-inspectorOpens and inspects Metal GPU .gputrace files using the gpudebug CLI. Covers draw calls, render encoders, pipeline state, resource bindings, textures, buffers, and shader source.
Analyzes Meta Quest and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Use when profiling frame drops, jank, or thermal issues on Quest devices.
Analyzes NVIDIA Nsight Systems GPU profiles (.sqlite/.nsys-rep) to identify root causes and fixes for bottlenecks, NCCL slowdowns, and efficiency issues.