Skip to content

Use backend addresses in copy-span packing - #859

Merged
jpsamaroo merged 2 commits into
masterfrom
jps/fix-metal-span-address
Dec 2, 2026
Merged

jpsamaroo merged 2 commits into
masterfrom
jps/fix-metal-span-address

Conversation

@jpsamaroo

@jpsamaroo jpsamaroo commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Memory-span packing converted array pointers directly to integers. Metal 1.9.3 exposes an opaque MtlPtr without that conversion, while Dagger already provides a compatible data_address(::MtlArray) hook. The conversion error can retain a Metal buffer handle and then fail again while Distributed serializes the exception.

Use the existing backend address hook for all four descriptor/gather/scatter bases, keeping them in the same numeric domain as aliasing. Register a CPU-backed opaque-pointer regression that exercises nontrivial span offsets, copying, gathering, scattering and the public byte-buffer wrappers.

Validation:

  • The committed regression on master 3dc3752b produces five expected opaque-pointer conversion errors; this head passes all 22 assertions.
  • The same production files at pre-final-test commit d845edd5 passed 11 memory-space assertions and an inference check. Five allocation samples of 1,000 CPU descriptor builds after 10 warmups and GC report 208,016 bytes / 6,001 allocations on both revisions. These are allocation-only controls; no timing claim is made.
  • Exact-head Metal CI build 2598 passed on Julia 1.11.9, Metal 1.9.3 and ObjectiveC 3.4.2: GPU 286 passed / 4 existing broken, and stencils 124 passed. The original pointer-conversion/exception-serialization failure is absent. The post-test Codecov token message was nonfatal. Metal MPI remains disabled.
  • Separate oneAPI and oneAPI-MPI jobs remain red with primary signatures also present in exact master build 2470 (accumulate wrong values / unsupported Float64 and Intel driver makeNonResident segmentation fault). Other queued checks and other Metal versions are not claimed validated.
  • AWS M2 capacity was unavailable in both zones permitted by existing quotas; no host or instance was allocated.

Written by an AI agent on jpsamaroo's review feedback.

Metal before 1.10 returns an opaque MtlPtr without UInt conversion. Span
packing bypassed the existing data_address compatibility hook, so a gather
could throw a MethodError whose retained Metal handle also broke remote
exception serialization. Use the same numeric domain as aliasing for the
descriptor, gather and scatter bases.

Register an opaque-pointer array regression through the memory-space suite
and document the address contract. A local allocation-only CPU comparison
of 1000 descriptor builds, after 10 warmups and GC, records 208016 bytes and
6001 allocations on both revisions in each of five samples. Concurrent
benchmark activity invalidates timing claims from these runs. Native Metal
validation remains pending; this does not establish a hardware CI pass.

Written by an AI agent on jpsamaroo's review feedback.
@jpsamaroo
jpsamaroo marked this pull request as ready for review December 2, 2026 03:27
@jpsamaroo
jpsamaroo merged commit 680c744 into master Dec 2, 2026
54 of 57 checks passed
@jpsamaroo
jpsamaroo deleted the jps/fix-metal-span-address branch December 2, 2026 03:28
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