---
title: "FuseReport: interface in Runtime, TypeShade API reference"
description: "FuseReport, an interface in Runtime. What a fuse scope did once its plan had run."
url: https://typeshade.dev/api/fusereport/
language: en
---

# `FuseReport`

Interface in Runtime

What a fuse scope did once its plan had run.

`import type { FuseReport } from 'typeshade'`
`import type { FuseReport } from 'typeshade/runtime'`
`import type { FuseReport } from 'typeshade/fuse'`

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

## Syntax

```ts
interface FuseReport {
  readonly tier: Tier;
  readonly dispatches: number;
  readonly submissions: number;
  readonly webgpuScratch?: { /** Newly created storage buffers acquired for scratch arrays. */ readonly allocations: number; /** The sum of those new buffers' descriptor sizes. */ readonly allocatedBytes: number; /** Existing storage buffers borrowed from the owner pool for scratch arrays. */ readonly reuses: number; /** The sum of those borrowed buffers' descriptor sizes. */ readonly reusedBytes: number; };
  readonly groups: readonly { readonly calls: readonly string[]; readonly fused: boolean; /** The tier the calls of the group ran on (change 0118): every call of a fused group ran on * WebGPU, and any other group is one call. A group that ran on a later tier than the plan's * `tier`, and that has no other reason to give, says why in `why`: `b runs on the CPU, ` or * `b runs on WebGL2, `, then the reason of each tier of the owner (`configure({ prefer })`, * `createDevice({ prefer })`) before its own, in that order, joined by `; `. Each reason is * the one the `Error` of a call that no tier can run gives that tier, without the * `webgpu: `, `webgl2: ` or `cpu: ` before it. */ readonly tier: Tier; /** Device commands this group made: direct/indirect dispatches on WebGPU, draws on WebGL2, * zero on the CPU. Includes push stages, reduction folds and store-only entries. These * counts sum to the report's `dispatches`; workgroup shapes do not determine them. */ readonly dispatches: number; readonly why?: string; /** The workgroup of each dispatch the group made on WebGPU, as `[n, 1, 1]`, in dispatch * order. A fused group or a single-loop call has one entry. A lone call of a function with * more than one loop has one entry per loop: a map loop then a reducing loop gives * `[[64,1,1],[256,1,1]]`. The fold levels of a reduction are not entries; they run at the * size of their reducing loop. The entry that stores after a function's loops adds none * (change 0094), so a function with no loop has `[]`. Absent exactly when the group does not * run on WebGPU. */ readonly workgroupShapes?: readonly (readonly [number, number, number])[]; /** The GPU time of the group's compute passes, in nanoseconds, as the device measured it with * timestamp queries (`timestamp-query`). Gaps between passes are in no group's time. The * browser may round each timestamp to a coarser step. Absent when the device did not measure * it: no `timestamp-query` feature, a group that does not run on WebGPU, or a failed read of * the timestamps. It is not 0 in those cases. */ readonly gpuTime?: number; /** Present, and `true`, for the group of an entry call whose workgroup count a * `Resident<Uint32Array>` holds, `entry(bindings, { indirect, offset? })` (change 0075). * Such a call is a group of its own. On WebGPU `dispatches` counts its dispatch once, whatever * the counts hold, since the plan does not read them. The CPU tier and WebGL2 read them from * the host copy when the call runs, and run nothing for a count with a 0 in it. */ readonly indirect?: true; }[];
  readonly chunk?: { readonly key: string; readonly units: number; readonly elapsedMs: number; };
}
```

## Description

Dispatch and submission counts describe calls to the device: a `dispatches` is one dispatch on WebGPU or one draw on WebGL2, and a `submissions` is one `queue.submit`, including a read of a `Resident` that the plan needed. `webgpuScratch` separately records storage acquired for the plan’s scratch arrays.

Exported from `typeshade/fuse`, from `typeshade/runtime` and from the root (change 0071, Amendment 2), so a host that holds a report types it without importing the planner.

## Instance properties

**`tier` read only `Tier`**

The best tier any call of the plan ran on, which is the best `tier` of its groups: WebGPU before WebGL2 before the CPU tier, and `'cpu'` when no call ran on a device. Each call runs on the first tier of `configure({ prefer })` that can run it, as a call outside a scope does.

**`dispatches` read only `number`**

How many dispatches the plan made: none on the CPU tier.

**`submissions` read only `number`**

How many times the plan gave the WebGPU queue commands: none on the other tiers. One for a scope whose calls all run on WebGPU, the calls that reduce among them: the loop of a reduction, the dispatches that fold its partials and the copy of what it folded to are in that submission. A call that runs on WebGL2 or the CPU tier reads its arrays from the host, so the plan submits what it holds before it, and each read of a `Resident` from the device that the call needs is a submission too.

**`webgpuScratch` optional read only `{ /** Newly created storage buffers acquired for scratch arrays. */ readonly allocations: number; /** The sum of those new buffers' descriptor sizes. */ readonly allocatedBytes: number; /** Existing storage buffers borrowed from the owner pool for scratch arrays. */ readonly reuses: number; /** The sum of those borrowed buffers' descriptor sizes. */ readonly reusedBytes: number; }`**

WebGPU storage acquired for this plan’s scratch arrays (change 0128). New runtime reports always include all four counters, including zeros. Omission in an older or manually made report means unknown. Bytes are buffer descriptor sizes, including layout padding, not physical GPU heap usage. Ordinary residents, reduction partials, staging, uniforms and WebGL2 or host storage are excluded.

**`groups` read only ``readonly { readonly calls: readonly string[]; readonly fused: boolean; /** The tier the calls of the group ran on (change 0118): every call of a fused group ran on * WebGPU, and any other group is one call. A group that ran on a later tier than the plan's * `tier`, and that has no other reason to give, says why in `why`: `b runs on the CPU, ` or * `b runs on WebGL2, `, then the reason of each tier of the owner (`configure({ prefer })`, * `createDevice({ prefer })`) before its own, in that order, joined by `; `. Each reason is * the one the `Error` of a call that no tier can run gives that tier, without the * `webgpu: `, `webgl2: ` or `cpu: ` before it. */ readonly tier: Tier; /** Device commands this group made: direct/indirect dispatches on WebGPU, draws on WebGL2, * zero on the CPU. Includes push stages, reduction folds and store-only entries. These * counts sum to the report's `dispatches`; workgroup shapes do not determine them. */ readonly dispatches: number; readonly why?: string; /** The workgroup of each dispatch the group made on WebGPU, as `[n, 1, 1]`, in dispatch * order. A fused group or a single-loop call has one entry. A lone call of a function with * more than one loop has one entry per loop: a map loop then a reducing loop gives * `[[64,1,1],[256,1,1]]`. The fold levels of a reduction are not entries; they run at the * size of their reducing loop. The entry that stores after a function's loops adds none * (change 0094), so a function with no loop has `[]`. Absent exactly when the group does not * run on WebGPU. */ readonly workgroupShapes?: readonly (readonly [number, number, number])[]; /** The GPU time of the group's compute passes, in nanoseconds, as the device measured it with * timestamp queries (`timestamp-query`). Gaps between passes are in no group's time. The * browser may round each timestamp to a coarser step. Absent when the device did not measure * it: no `timestamp-query` feature, a group that does not run on WebGPU, or a failed read of * the timestamps. It is not 0 in those cases. */ readonly gpuTime?: number; /** Present, and `true`, for the group of an entry call whose workgroup count a * `Resident<Uint32Array>` holds, `entry(bindings, { indirect, offset? })` (change 0075). * Such a call is a group of its own. On WebGPU `dispatches` counts its dispatch once, whatever * the counts hold, since the plan does not read them. The CPU tier and WebGL2 read them from * the host copy when the call runs, and run nothing for a count with a 0 in it. */ readonly indirect?: true; }[]``**

The groups of calls, in order, each by the names of its kernel functions. A group that is `fused` shares a loop dispatch, with additional dispatches for reduction folds. `why` says, in the author’s words, why a group stands apart from the one before it, or why it ran on a later tier than the plan’s (see the group’s `tier`); a group with nothing to say leaves it out.

**`chunk` optional read only `{ readonly key: string; readonly units: number; readonly elapsedMs: number; }`**

The chunk of a long kernel the plan ran (change 0074): present exactly when the plan was `device.fuse(body, { chunk })`. `key` and `units` are the chunk’s, and `elapsedMs` is the wall time, in milliseconds, from the start of the plan to its fence (`device.wait()`), which the device learns the rate of `key` from.

## Source

[`src/core/fuse-report.ts`, line 19](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/fuse-report.ts#L19), at commit af54ddad5
