Repository navigation
v0.35.3
A PATCH release: the device-lost notification channel, a large allocation win in the software backend, and the shader readback corpus now running on real devices in CI.
Device-lost and uncaptured-error callbacks (#417)
func (d *Device) SetLostCallback(fn func(DeviceLostInfo))
func (d *Device) SetUncapturedErrorCallback(fn func(*GPUError))
func (d *Device) LostInfo() (DeviceLostInfo, bool)
type DeviceLostReason int // DeviceLostReasonUnknown, DeviceLostReasonDestroyed
type DeviceLostInfo struct { Reason DeviceLostReason; Message string }A driver loss observed on submit, poll, surface acquire or present reports DeviceLostReasonUnknown; Release reports DeviceLostReasonDestroyed; the first loss wins. Errors that reach no error scope are delivered with the same *GPUError the scopes return, so errors.Is classification is identical. Callbacks run on the goroutine of the call that observes the event, never under an internal device/queue/encoder lock, and may read LostInfo and other read-only accessors. PopErrorScope gains the spec's fourth case: on a lost device it resolves (nil, nil) whatever the stack holds.
Per-build limit with -tags rust: the pinned binding (webgpu v0.5.5) exposes no lost or uncaptured-error source, so there the only loss reported is Destroyed after Release(); the driver and uncaptured sources land with webgpu v0.6.0.
Software interpreter: per-invocation arena (#419, second lever)
Per-fragment temporaries (access-chain index paths, composite backings, sampled-image boxes) now come from one scratch arena per entry-point invocation, with a heap fallback past its fixed capacities. On the gate's A/B harness, 1280×720, software backend (Intel Iris Xe host, i7-1255U, naga v0.22.7): fullscreen textured draw 10,159,491 → 186 allocations/op, 347.5 MB → 61.9 KB; 512 small quads bytes per draw −86% (140,205 → 19,746); ExecuteQuad 40 → 0 allocs/op. The first lever shipped in v0.35.2.
The readback corpus in CI
The naga corpus now runs on lavapipe with the Khronos validation layer (which proves itself: a deliberately invalid case must fail), on WARP, and on llvmpipe GLES. WGPU_REQUIRE covers the corpus — a listed backend that is missing, or a validation layer that never loaded, fails the job instead of skipping it.
Also
- naga v0.22.7: dependency-order parser fix, clearer type-size refusals, byte-identical output for every shader that compiled before.
CheckHealthnow latches the same lost path as the callbacks.- Internal documentation pins for
MapPending's pool return andResize's eager/lazy contrast.