Skip to content

Custom WGSL Views

A spec carries WGSL programs over live tensors, with sandbox checks and limits on GPU time and memory.

Field Value
ID SPC-14
Status Shipped
Scope Core
Pillar Builder and Specs
Sprint None
Depends On Spec Version 1 with Scenes (SPC-11)
Unblocks Program Sandbox (REN-76)
Review of Custom Views (SPC-23)
Custom View Starter Kit (SPC-24)
Pieces (SPC-50)
Docs GPU Programs, Programs
Branches None
Design Roadmap, Open questions

Coverage Ledger

  • design/gpu-programs.md, under Spec Additions. Spec version 1 gains the top-level keys program, stage and provenance.
  • design/gpu-programs.md, under Program Declaration. A program declares its WGSL source, its read-only inputs by tensor name, one output and its limits.
  • design/gpu-programs.md, under Geometry Output. A geometry output writes named arrays and a count that the script publishes as a scene batch on one entity.
  • design/gpu-programs.md, under Pixels Output. A pixels output writes an RGBA8 image that the script publishes as the live view program.<id>.
  • design/gpu-programs.md, under Frame Uniform. A program may declare the uniform caliper, which holds the step, the pass index and the output sizes.
  • design/gpu-programs.md, under Program Commands. The commands program.create, program.patch and program.remove edit programs, and program.status reads their state.
  • design/gpu-programs.md, under Sandbox. The same sandbox checks run in the editor, in the producer runtime and in the viewer.
  • design/gpu-programs.md, under Check Order. The sandbox checks the declaration, the provenance, the source, the compile, the bindings, the imports, the memory and the layer, in that order.
  • design/gpu-programs.md, under Time Watchdog. A watchdog stops a program that exceeds its GPU time limit.
  • design/gpu-programs.md, under Host Errors. Program hosts report fixed error codes in status and events.
  • design/gpu-programs.md, under Cadence. The runtime runs programs every N steps, with N from the measured pass cost and step time, so that training keeps 95 percent of its speed.
  • design/gpu-programs.md, under Views in the Cadence. The snapshots, series chunks and scene colors that viewers ask for run only on the pass steps of the same cadence, inside 2 percent of the training time while views are attached.
  • design/gpu-programs.md, under Waiting Loops. A loop that already waits for the GPU at each step gets a mark only every 8 steps and around a pass.
  • design/gpu-programs.md, under Wire Path. A program reaches the script in a new PROGRAM message, and its outputs return as scene updates and snapshots.
  • design/gpu-programs.md, under Program Messages. The messages PROGRAM and PROGRAM_STATE, under the capability programs, install programs and carry their status.
  • design/gpu-programs.md, under Attachment. The app keeps the programs of the attached script equal to the programs of the open spec.
  • design/gpu-programs.md, under Output Route. The script publishes each output through the publish path of caliper.scene or caliper.show.
  • design/gpu-programs.md, under Program Status. The command program.status and the message PROGRAM_STATE carry one status item for each program.
  • design/gpu-programs.md, under Producer Runtime Interface. A C interface and two Python files fix where the producer runtime meets the native module and the wire path.
  • design/gpu-programs.md, under Acceptance Test. A test through caliper-mcp builds programs, a library piece and an ablation toggle on a managed run.
  • design/gpu-programs.md, under Bounds Checks. The compiler adds bounds checks to buffer, texel and index accesses in each program.
  • design/gpu-programs.md, under Edit Rules. Program edits support dry runs, review, undo, and journal entries.
  • design/instrument-interface.md, under Operator Placement. The first operator of a live tensor source runs in the script on the producer runtime, and other steps run in the app.
  • design/instrument-interface.md, under Operator Programs. A placed operator travels as a built-in program in the message PROGRAM, with the same sandbox and cadence.
  • design/instrument-interface.md, under Tensor Output. Programs gain the output kind tensor, which the script publishes as a live tensor view.
  • design/instrument-interface.md, under Program Parameters. Programs and stages read named parameters, which may be references, in a uniform struct.
  • design/instrument-interface.md, under Work Placement. Each piece runs in the app or in the script as the table states.
  • design/producer-runtime.md, under Producer Runtime. The graphics layer without a window as a native module in the training process, with WGSL compute that reads training tensors in place.
  • design/producer-runtime.md, under Design. Section heading for the design of the producer runtime.
  • design/producer-runtime.md, under Components. The native module caliper._producer, the torch adapter and the Python facade of caliper.watch.
  • design/producer-runtime.md, under Framework Adapter Interface. The adapter's export, sync, hook, probe and state functions and the native module's interface.
  • design/producer-runtime.md, under Threads. The runtime runs on the training thread and adds no thread.
  • design/producer-runtime.md, under Read-Only Rule. Naga validation, the binder rule and a read-only import in the layer refuse a write to a training tensor.
  • design/producer-runtime.md, under Budget per Step. At most 4 % of the step time, with an adaptive rate and a skip over the time limit.
  • design/producer-runtime.md, under Cadence Measurement. The step time T and the cost C of a pass step measured between two empty queues of torch, for the cadence N.
  • design/producer-runtime.md, under Output Path. Compute outputs as scene batches in process, through the shared-memory slot and over the network, through the existing publish calls.
  • design/producer-runtime.md, under On-Demand Load. caliper._producer loads only when a spec first binds agent code to a tensor of the script.
  • design/producer-runtime.md, under Failure Behavior. Refusals on old torch versions, refused imports and programs, over-budget programs and a lost device.
  • design/producer-runtime.md, under Work Items. The work items of the producer runtime with their sizes.
  • design/roadmap.md, under Invariants. Applets supply no shaders.
  • design/roadmap.md, under Open questions. Applet shaders: whether applets still supply no shaders once agent-built panels exist.
  • design/spec-format.md, under Programs and Provenance. Programs and provenance remain in version 1, and library pieces replace the former stage tables.
  • Pieces, Piece Commands. Graphics Consolidation replaces stage hooks with library pieces.
  • Pieces, Program Status and Events. Program status and events gain the draw half, the pass and the pick fields.
  • GPU Programs, Programs. A program declares its WGSL source, its read-only inputs, one output and its limits.
  • Spec Version 1, Old Stage Tables. Old stage tables require a replacement piece.

Roadmap Graph Feature in Graph