Skip to content

v0.30.28 — unified resource lifecycle (ADR-056, Rust wgpu parity)

Choose a tag to compare

@kolkov kolkov released this 30 Jul 12:00
146bc28

Fixed

  • Resource lifecycle: BindGroup/Pipeline Release() bypasses ref-counting
    Release() called dq.Defer(lastSubmissionIndex) directly, ignoring the
    ResourceRef ref-counting system. On shared encoder path, this caused
    use-after-free: HAL resource destroyed while GPU still processing commands.
    Now Release() calls ref.Drop() — HAL destruction deferred until ALL
    refs (user + GPU) are dropped. Matches Rust wgpu Arc<BindGroup> pattern.
    Applied to: BindGroup, RenderPipeline, ComputePipeline. (#287)

  • DestroyQueue deadlock: Triage → onZero → Defer re-entry
    Triage() held mutex while executing callbacks. When onZero fired and
    called Defer(), it tried to acquire the same mutex → deadlock. Now
    callbacks execute outside the lock. Same fix applied to FlushAll().

Tests

  • 6 new lifecycle tests: refcount transitions, Release-before-Submit,
    Release-without-Clone, mixed-resource TrackedSubmission, buffer binding scenario