Repository navigation
Use backend addresses in copy-span packing - #859
Merged
Merged
Conversation
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
marked this pull request as ready for review
December 2, 2026 03:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Memory-span packing converted array pointers directly to integers. Metal 1.9.3 exposes an opaque
MtlPtrwithout that conversion, while Dagger already provides a compatibledata_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:
3dc3752bproduces five expected opaque-pointer conversion errors; this head passes all 22 assertions.d845edd5passed 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.makeNonResidentsegmentation fault). Other queued checks and other Metal versions are not claimed validated.Written by an AI agent on jpsamaroo's review feedback.