Skip to content

v0.28.5: Metal defer pool.Drain + drawable count + indirect validation nil guard#190

Merged
kolkov merged 3 commits into
mainfrom
release/v0.28.5
May 21, 2026
Merged

v0.28.5: Metal defer pool.Drain + drawable count + indirect validation nil guard#190
kolkov merged 3 commits into
mainfrom
release/v0.28.5

Conversation

@kolkov
Copy link
Copy Markdown
Contributor

@kolkov kolkov commented May 21, 2026

Summary

  • Metal: defer pool.Drain() in Present() — prevents autorelease leak on panic (Rust uses closure-scoped autoreleasepool)
  • Metal: setMaximumDrawableCount:3 in Configure() — Rust wgpu parity (surface.rs:176)
  • Core: indirect validation nil guard (v0.28.4: nil pointer in buildIndirectValidation during NewDevice #189) — skip on noop/test backends where MaxComputeWorkgroupSizeX=0 (Rust checks DownlevelFlags::INDIRECT_EXECUTION)

All verified against Rust wgpu-hal Metal reference.

Test plan

  • go build ./... — Windows, Linux, macOS
  • go test ./... — all pass
  • golangci-lint run --timeout=5m — 0 issues

kolkov added 3 commits May 21, 2026 13:58
errcheck: check DataProviderRelease/ImageRelease/SetDevice returns.
nestif: restructure init() with early return.
revive: eliminate 10 redundant if-return patterns.
staticcheck: use embedded field directly (s.objc not s.platformBlit.objc).
unconvert: remove 13 unnecessary unsafe.Pointer() wrappings.
unused: remove cifMetalRegionMake2D, unused objc fields.

0 lint issues on Windows + Linux + macOS.
…alidation nil guard

Metal:
- Queue.Present(): defer pool.Drain() prevents autorelease leak on panic
  (Rust uses closure-scoped autoreleasepool for same guarantee)
- Surface.Configure(): setMaximumDrawableCount:3 (Rust wgpu parity,
  surface.rs:176 — maximum_frame_latency + 1)

Core:
- indirect_validation: skip init when MaxComputeWorkgroupSizeX=0
  (noop/test backends). Rust checks DownlevelFlags::INDIRECT_EXECUTION.
- nil guard on dstBuffer/paramsBuffer before NativeHandle() call.

Closes #189.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
core/indirect_validation.go 0.00% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit 2fe3380 into main May 21, 2026
10 of 11 checks passed
@kolkov kolkov deleted the release/v0.28.5 branch May 21, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant