Skip to main content

Module memory_budget

Module memory_budget 

Source
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)

LimitDefaultNotes
maxStorageBufferBindingSize128 MBPer binding, per shader stage
maxBufferSize256 MBTotal per buffer object
maxUniformBufferBindingSize64 KBUniform blocks are small
maxStorageBuffersPerShaderStage8Max bindings per stage
maxComputeWorkgroupStorageSize16 KBShared workgroup memory
maxComputeInvocationsPerWorkgroup256Threads per workgroup
maxComputeWorkgroupSizeX256
maxComputeWorkgroupSizeY256
maxComputeWorkgroupSizeZ64
maxComputeWorkgroupsPerDimension65535

Structs§

GpuMemoryBudget
Tracks GPU buffer allocations and enforces limits.
GpuMemoryLimits
WebGPU hardware limits, initialized to W3C default minimums.
OrbitalGridMemoryEstimate
Memory estimation for orbital grid dispatch.
PairwiseMemoryEstimate
Memory estimation for pairwise computations (D4, EEQ Coulomb).

Enums§

MemoryError
Errors from GPU memory budget checks.