---
title: "Runtime, a category in the TypeShade API reference"
description: "Runtime in the TypeShade API reference. The program runtime that runs compiled programs on WebGPU, the array a kernel call keeps on the device…"
url: https://typeshade.dev/api/runtime-api/
language: en
---

# Runtime

92 members

The program runtime that runs compiled programs on WebGPU, the array a kernel call keeps on the device, and the host types a host view spells values with.

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

**[`array`](https://typeshade.dev/api/array/) Function**

A storage array of the structs of cls that data holds, a Buffer; or, with a typed array, a Buffer of its scalars that keeps it on the device across calls (Amendment A1: `array(xs)` replaces resident(xs); Amendment A10, Q-I): a Buffer<`f32`> for a Float32Array or a number\[\], and so on; or, with a length and an element, a zeroed Buffer of scalars.

**[`Bindings`](https://typeshade.dev/api/bindings/) Type**

A draw or dispatch binds values by the names the source declares.

**[`BindingsOf`](https://typeshade.dev/api/bindingsof/) Type**

The bindings entry K of the manifest P reaches, as a draw or a dispatch passes them: BindingsOf<typeof mesh, 'vs'>.

**[`bool`](https://typeshade.dev/api/bool-type/) Type**

A bool as a host value: a boolean, with its name as a number has its name.

**[`Buffer`](https://typeshade.dev/api/buffer/) Interface**

An array on the device of length elements T: a Buffer of structs, one range of the region laid out as a storage array with no size (Rule 6.8), made by zeros or array with a class; or a Buffer of scalars or vectors, made by `array(xs)` of a typed array, array or a kernel called on a resource.

**[`buildInfo`](https://typeshade.dev/api/buildinfo/) Constant**

Frozen package information. Source checkouts are unstamped.

**[`callDevice`](https://typeshade.dev/api/calldevice/) Function**

The report of the device the calls run on, as gpuDevice() gives it: the device is requested as a call requests it.

**[`ChunkRate`](https://typeshade.dev/api/chunkrate/) Interface**

What a device measured of one chunk key: the time one unit takes, as the device learned it from the chunks so far, how many chunks it ran, the longest of them and the units of the last one.

**[`CompareFunction`](https://typeshade.dev/api/comparefunction/) Type**

WebGPU GPUCompareFunction: how a depth test compares a fragment with the stored value.

**[`ComputePipeline`](https://typeshade.dev/api/computepipeline/) Interface**

A compute pipeline: one entry, dispatched with bindings by name.

**[`configure`](https://typeshade.dev/api/configure/) Function**

Set how a default-owner kernel call or `@compute` entry's call runs (Rule 11.8).

**[`createDevice`](https://typeshade.dev/api/createdevice/) Function**

Open the owner of a host's kernel calls: on the first tier of prefer that opens, on a GPUDevice the host already has, or on the device of a program runtime.

**[`createRuntime`](https://typeshade.dev/api/createruntime/) Function**

Creates a runtime on the host's device or WebGL2 context, or on the first available tier in \`prefer\`: a WebGPU device meeting the programs' feature requirements and the limits requested by the programs and \`limits\` option, or a new WebGL2 context.

**[`DepthAttachment`](https://typeshade.dev/api/depthattachment/) Type**

A depth attachment: the depth aspect of one texture, and its stencil object when the format has a stencil aspect.

**[`Device`](https://typeshade.dev/api/device/) Interface**

The owner of a host's kernel calls: the tier they run on, the Buffers they take and the pool those arrays return to, the device's limits and lost signal, the plans of fuse(), and dispose().

**[`DeviceInfo`](https://typeshade.dev/api/deviceinfo/) Interface**

Frozen, JSON-serializable historical metadata of an opened device.

**[`DeviceOptions`](https://typeshade.dev/api/deviceoptions/) Type**

How createDevice() opens a device.

**[`DeviceReport`](https://typeshade.dev/api/devicereport/) Interface**

What callDevice() reports of the device the calls run on: its numeric limits, keyed by WebGPU's names, and its enabled features in sorted order.

**[`DeviceStatistics`](https://typeshade.dev/api/devicestatistics/) Interface**

What a device counts of the arrays it made.

**[`f32`](https://typeshade.dev/api/f32-type/) Type**

An `f32` as a host value (Rule 8.21): a number, which a call rounds as a buffer write rounds it.

**[`f64`](https://typeshade.dev/api/f64-type/) Type**

An `f64` (Rule 4.4) as a host value: a number, kept as a double.

**[`Frame`](https://typeshade.dev/api/frame/) Interface**

One command encoder's work: dispatches and render passes, submitted together.

**[`fuse`](https://typeshade.dev/api/fuse/) Function**

Run a chain of kernel-function calls as one plan, and resolve to a report of what the plan did.

**[`FuseReport`](https://typeshade.dev/api/fusereport/) Interface**

What a fuse scope did once its plan had run.

**[`FuseScope`](https://typeshade.dev/api/fusescope/) Interface**

What the body of a fuse call receives: the scope that records the kernel calls the body makes, and makes the scratch arrays they share.

**[`Geometry`](https://typeshade.dev/api/geometry/) Interface**

What a draw draws: count vertices, instances times, from the vertex buffer the manifest lays out.

**[`i32`](https://typeshade.dev/api/i32-type/) Type**

An `i32` as a host value: a number, a whole number in the `i32` range, which a call checks.

**[`LoadOptions`](https://typeshade.dev/api/loadoptions/) Interface**

How rt.load() loads a program.

**[`mat2`](https://typeshade.dev/api/mat2/) Type**

`mat2`, the short spelling of `mat2x2`, the same type.

**[`mat2x2`](https://typeshade.dev/api/mat2x2/) Type**

A `mat2x2` as a host value: a readonly tuple of its 4 components, column-major.

**[`mat2x2f`](https://typeshade.dev/api/mat2x2f/) Type**

WGSL's `mat2x2f`, the same type as `mat2x2`.

**[`mat2x3`](https://typeshade.dev/api/mat2x3/) Type**

A `mat2x3`, 2 columns of 3 rows, as a host value: a readonly tuple of its 6 components, column-major.

**[`mat2x3f`](https://typeshade.dev/api/mat2x3f/) Type**

WGSL's `mat2x3f`, the same type as `mat2x3`.

**[`mat2x4`](https://typeshade.dev/api/mat2x4/) Type**

A `mat2x4`, 2 columns of 4 rows, as a host value: a readonly tuple of its 8 components, column-major.

**[`mat2x4f`](https://typeshade.dev/api/mat2x4f/) Type**

WGSL's `mat2x4f`, the same type as `mat2x4`.

**[`mat3`](https://typeshade.dev/api/mat3/) Type**

`mat3`, the short spelling of `mat3x3`, the same type.

**[`mat3x2`](https://typeshade.dev/api/mat3x2/) Type**

A `mat3x2`, 3 columns of 2 rows, as a host value: a readonly tuple of its 6 components, column-major.

**[`mat3x2f`](https://typeshade.dev/api/mat3x2f/) Type**

WGSL's `mat3x2f`, the same type as `mat3x2`.

**[`mat3x3`](https://typeshade.dev/api/mat3x3/) Type**

A `mat3x3` as a host value: a readonly tuple of its 9 components, column-major.

**[`mat3x3f`](https://typeshade.dev/api/mat3x3f/) Type**

WGSL's `mat3x3f`, the same type as `mat3x3`.

**[`mat3x4`](https://typeshade.dev/api/mat3x4/) Type**

A `mat3x4`, 3 columns of 4 rows, as a host value: a readonly tuple of its 12 components, column-major.

**[`mat3x4f`](https://typeshade.dev/api/mat3x4f/) Type**

WGSL's `mat3x4f`, the same type as `mat3x4`.

**[`mat4`](https://typeshade.dev/api/mat4/) Type**

`mat4`, the short spelling of `mat4x4`, the same type.

**[`mat4x2`](https://typeshade.dev/api/mat4x2/) Type**

A `mat4x2`, 4 columns of 2 rows, as a host value: a readonly tuple of its 8 components, column-major.

**[`mat4x2f`](https://typeshade.dev/api/mat4x2f/) Type**

WGSL's `mat4x2f`, the same type as `mat4x2`.

**[`mat4x3`](https://typeshade.dev/api/mat4x3/) Type**

A `mat4x3`, 4 columns of 3 rows, as a host value: a readonly tuple of its 12 components, column-major.

**[`mat4x3f`](https://typeshade.dev/api/mat4x3f/) Type**

WGSL's `mat4x3f`, the same type as `mat4x3`.

**[`mat4x4`](https://typeshade.dev/api/mat4x4/) Type**

A `mat4x4` as a host value: a readonly tuple of its 16 components, column-major.

**[`mat4x4f`](https://typeshade.dev/api/mat4x4f/) Type**

WGSL's `mat4x4f`, the same type as `mat4x4`.

**[`mergeReports`](https://typeshade.dev/api/mergereports/) Function**

The report of several plans as one, as a plan of several groups reports its own: the dispatches and the submissions summed, the groups in the order given, and the tier the most capable report ran on.

**[`PassTargets`](https://typeshade.dev/api/passtargets/) Interface**

A render pass's attachments: textures, or a canvas context the host configured.

**[`Program`](https://typeshade.dev/api/program/) Interface**

A program loaded on a runtime: its manifest and its pipelines.

**[`RenderPass`](https://typeshade.dev/api/renderpass/) Interface**

A render pass of a frame: draws recorded into it.

**[`RenderPipeline`](https://typeshade.dev/api/renderpipeline/) Interface**

A render pipeline: a vertex entry, a fragment entry and the state, drawn with bindings by name.

**[`RenderState`](https://typeshade.dev/api/renderstate/) Interface**

The fixed-function state of a render pipeline, which the host writes: the compiler knows its entries' inputs and outputs, and the runtime fills and checks those.

**[`runtime`](https://typeshade.dev/api/runtime/) Function**

The default runtime: the one configure named, or one on the device the call layer uses, so a resource made on either layer is used on the other.

**[`Runtime`](https://typeshade.dev/api/runtime-interface/) Interface**

The program runtime: a device, and everything a program needs on it.

**[`RuntimeOptions`](https://typeshade.dev/api/runtimeoptions/) Interface**

How createRuntime() makes a runtime.

**[`Sampler`](https://typeshade.dev/api/sampler/) Interface**

A sampler the runtime binds by name.

**[`SamplerOptions`](https://typeshade.dev/api/sampleroptions/) Interface**

What rt.sampler() makes.

**[`StencilFaceState`](https://typeshade.dev/api/stencilfacestate/) Interface**

WebGPU GPUStencilFaceState: the stencil test and its three operations for one face.

**[`StencilOperation`](https://typeshade.dev/api/stenciloperation/) Type**

WebGPU GPUStencilOperation: what a stencil test does to the value a pixel stores.

**[`StencilState`](https://typeshade.dev/api/stencilstate/) Interface**

The stencil test of a pipeline.

**[`texture`](https://typeshade.dev/api/texture/) Function**

A texture of the block's default device: using \_ = device.use() names the device, and the texture is the one device.texture(options) makes.

**[`Texture`](https://typeshade.dev/api/texture-interface/) Interface**

A texture the runtime binds by name and renders into: a sampled texture, a render target, a depth or shadow map.

**[`TextureOptions`](https://typeshade.dev/api/textureoptions/) Interface**

What rt.texture() makes. format is any GPUTextureFormat the device can render to or sample: rgba8unorm, rgba16float, depth24plus, r32float.

**[`TypeShadeBuildInfo`](https://typeshade.dev/api/typeshadebuildinfo/) Interface**

The package build, separate from a program's compiler or a benchmark's revision.

**[`u32`](https://typeshade.dev/api/u32-type/) Type**

A `u32` as a host value: a number, a whole number from 0 to 4294967295, which a call checks.

**[`uniform`](https://typeshade.dev/api/uniform/) Function**

A uniform of the struct of cls, a class a shader module exports: one range of the region, zeroed, then given the fields init names.

**[`Uniform`](https://typeshade.dev/api/uniform-type/) Type**

A uniform of the struct T: one range of the region laid out by the uniform rules of Rule 6.8, with an accessor for each field.

**[`vec2`](https://typeshade.dev/api/vec2-type/) Type**

A `vec2`, the vector of two `f32`, as a host value: a readonly tuple of two `f32`.

**[`vec2b`](https://typeshade.dev/api/vec2b/) Type**

A `vec2b` as a host value: a readonly tuple of two bool.

**[`vec2d`](https://typeshade.dev/api/vec2d/) Type**

`vec2d`, the short spelling of `vec2f64`, the same type.

**[`vec2f`](https://typeshade.dev/api/vec2f/) Type**

WGSL's `vec2f`, the same type as `vec2`.

**[`vec2f64`](https://typeshade.dev/api/vec2f64-type/) Type**

A `vec2f64` (Rule 4.4) as a host value: a readonly tuple of two `f64`.

**[`vec2i`](https://typeshade.dev/api/vec2i-type/) Type**

A `vec2i` as a host value: a readonly tuple of two `i32`.

**[`vec2u`](https://typeshade.dev/api/vec2u-type/) Type**

A `vec2u` as a host value: a readonly tuple of two `u32`.

**[`vec3`](https://typeshade.dev/api/vec3-type/) Type**

A `vec3`, the vector of three `f32`, as a host value: a readonly tuple of three `f32`.

**[`vec3b`](https://typeshade.dev/api/vec3b/) Type**

A `vec3b` as a host value: a readonly tuple of three bool.

**[`vec3d`](https://typeshade.dev/api/vec3d/) Type**

`vec3d`, the short spelling of `vec3f64`, the same type.

**[`vec3f`](https://typeshade.dev/api/vec3f/) Type**

WGSL's `vec3f`, the same type as `vec3`.

**[`vec3f64`](https://typeshade.dev/api/vec3f64-type/) Type**

A `vec3f64` (Rule 4.4) as a host value: a readonly tuple of three `f64`.

**[`vec3i`](https://typeshade.dev/api/vec3i-type/) Type**

A `vec3i` as a host value: a readonly tuple of three `i32`.

**[`vec3u`](https://typeshade.dev/api/vec3u-type/) Type**

A `vec3u` as a host value: a readonly tuple of three `u32`.

**[`vec4`](https://typeshade.dev/api/vec4-type/) Type**

A `vec4`, the vector of four `f32`, as a host value: a readonly tuple of four `f32`.

**[`vec4b`](https://typeshade.dev/api/vec4b/) Type**

A `vec4b` as a host value: a readonly tuple of four bool.

**[`vec4d`](https://typeshade.dev/api/vec4d/) Type**

`vec4d`, the short spelling of `vec4f64`, the same type.

**[`vec4f`](https://typeshade.dev/api/vec4f/) Type**

WGSL's `vec4f`, the same type as `vec4`.

**[`vec4f64`](https://typeshade.dev/api/vec4f64-type/) Type**

A `vec4f64` (Rule 4.4) as a host value: a readonly tuple of four `f64`.

**[`vec4i`](https://typeshade.dev/api/vec4i-type/) Type**

A `vec4i` as a host value: a readonly tuple of four `i32`.

**[`vec4u`](https://typeshade.dev/api/vec4u-type/) Type**

A `vec4u` as a host value: a readonly tuple of four `u32`.

**[`zeros`](https://typeshade.dev/api/zeros/) Function**

A storage array of length zeroed structs of cls, a class a shader module exports: one range of the region.
