Expand description
GPU Memory Budget — WebGPU/WASM limit enforcement.
WebGPU imposes strict hardware limits that vary by platform. This module tracks buffer allocations against these limits and provides pre-flight checks before GPU dispatch to prevent silent failures or OOM.
§WebGPU Default Limits (W3C spec)
| Limit | Default | Notes |
|---|---|---|
| maxStorageBufferBindingSize | 128 MB | Per binding, per shader stage |
| maxBufferSize | 256 MB | Total per buffer object |
| maxUniformBufferBindingSize | 64 KB | Uniform blocks are small |
| maxStorageBuffersPerShaderStage | 8 | Max bindings per stage |
| maxComputeWorkgroupStorageSize | 16 KB | Shared workgroup memory |
| maxComputeInvocationsPerWorkgroup | 256 | Threads per workgroup |
| maxComputeWorkgroupSizeX | 256 | |
| maxComputeWorkgroupSizeY | 256 | |
| maxComputeWorkgroupSizeZ | 64 | |
| maxComputeWorkgroupsPerDimension | 65535 |
Structs§
- GpuMemory
Budget - Tracks GPU buffer allocations and enforces limits.
- GpuMemory
Limits - WebGPU hardware limits, initialized to W3C default minimums.
- Orbital
Grid Memory Estimate - Memory estimation for orbital grid dispatch.
- Pairwise
Memory Estimate - Memory estimation for pairwise computations (D4, EEQ Coulomb).
Enums§
- Memory
Error - Errors from GPU memory budget checks.