Skip to content

Copy allocated arrays through backend-owned transfers - #16

Merged
PraneethMerugu merged 1 commit into
mainfrom
codex/backend-owned-array-allocation
Sep 9, 2026
Merged

Copy allocated arrays through backend-owned transfers#16
PraneethMerugu merged 1 commit into
mainfrom
codex/backend-owned-array-allocation

Conversation

@PraneethMerugu

Copy link
Copy Markdown
Owner

Summary

  • copy allocated arrays through the owning backend instead of invoking Base's
    generic destination copy on device storage
  • preserve the unchanged synchronous Base copy for CPU storage
  • materialize unsupported ordinary host views before crossing the backend
    transfer boundary while retaining native device-to-device transfers
  • exercise independent ownership for reversed CPU views, strided structured
    host views on Metal, and native MtlArray sources
  • document the qualified CPU/Metal view-allocation contract

Why this is required

CorePotts' structured maintained-quantity rebuild supplies ordinary array views
to LocalMath's existing Allocate(source) boundary. The former generic
copyto! implementation attempted scalar indexing when that host view targeted
Metal storage. This change corrects the sole cold allocation copier; it adds no
second executor, storage authority, or backend registry.

Validation

  • full ordinary LocalMath suite: 1,735/1,735
  • focused storage, package-quality, and runner-inventory cohort: passed
  • complete actual-Metal owner suite with scalar indexing disabled: passed
  • focused Metal authoring and transfer fixture: 37/37
  • downstream CorePotts structured maintained-sum Metal fixture: 24/24
  • strict documentation build: passed
  • independent review: no blocking finding
  • git diff --check: passed

CPU and Metal are the qualified paths. Dispatch applicability is not presented
as a blanket capability guarantee for CUDA, ROCm, custom backends, or arbitrary
provider array wrappers; those combinations retain their own later conformance
work.

@PraneethMerugu
PraneethMerugu merged commit 5bac0c5 into main Sep 9, 2026
7 checks passed
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