Skip to content

Adapt to ObjectiveC.jl type model rework#776

Merged
maleadt merged 7 commits into
mainfrom
tb/objectivec
May 12, 2026
Merged

Adapt to ObjectiveC.jl type model rework#776
maleadt merged 7 commits into
mainfrom
tb/objectivec

Conversation

@maleadt
Copy link
Copy Markdown
Member

@maleadt maleadt commented May 11, 2026

The Objective-C class hierarchy is no longer modeled via Julia's `<:`, so the
old `where {K<:ParentClass}` signatures (which used to dispatch over all of a
parent class's subclasses) only match the parent itself now. This commit
migrates those callers:

- Methods polymorphic over a parent class use `@objcdispatch` with `KindOf{T}`
  arguments (MPSMatrixRandom encode!, MPSNDArrayMultiary/Unary/Binary encode!,
  MPSUnaryImageKernel encode!, MTLCommandEncoder endEncoding!, MTLEvent
  encode_signal!/encode_wait!).
- Where two `@objcdispatch` methods on different parents would generate
  identical `(::Object, ...)` forwarders (Unary 2-arg vs Binary 2-arg, both
  taking two MPSNDArrays), a single hand-written method on `::Object` branches
  on `inherits_from` instead.
- `Base.copy(::MPSKernel)` and `Base.close(::MTLCommandEncoder)` stay manual
  because the body needs `typeof(kernel)` to rebuild the return wrapper /
  delegate to the right dispatched function.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@maleadt maleadt marked this pull request as ready for review May 12, 2026 09:08
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

❌ Patch coverage is 49.25373% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.52%. Comparing base (771eec9) to head (d9f12d3).

Files with missing lines Patch % Lines
lib/mps/ndarray.jl 20.83% 19 Missing ⚠️
lib/mpsgraphs/tensor.jl 0.00% 4 Missing ⚠️
lib/mtl/command_buf.jl 72.72% 3 Missing ⚠️
lib/mps/images.jl 0.00% 2 Missing ⚠️
lib/mps/matrixrandom.jl 66.66% 2 Missing ⚠️
lib/mps/command_buf.jl 50.00% 1 Missing ⚠️
lib/mps/decomposition.jl 50.00% 1 Missing ⚠️
lib/mps/kernel.jl 66.66% 1 Missing ⚠️
lib/mps/matrix.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #776      +/-   ##
==========================================
- Coverage   80.65%   80.52%   -0.13%     
==========================================
  Files          61       61              
  Lines        2843     2845       +2     
==========================================
- Hits         2293     2291       -2     
- Misses        550      554       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt maleadt merged commit 5ebbccd into main May 12, 2026
12 checks passed
@maleadt maleadt deleted the tb/objectivec branch May 12, 2026 09:27
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