Skip to content

Keep geometry and mask allocation on the native array device - #8

Merged
trissim merged 2 commits into
mainfrom
fix/native-image-geometry
Oct 6, 2026
Merged

trissim merged 2 commits into
mainfrom
fix/native-image-geometry

Conversation

@trissim

@trissim trissim commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Mixed image-channel composition and image masks can now reshape, broadcast and allocate ones through MemoryType, retaining the actual input/reference device instead of making an implicit NumPy roundtrip. ArrayOperations owns shared algorithms through a nominal ABC and framework subclasses; its existing declaration constants and conversion/scaling semantics remain intact.

Pyclesperanto explicitly rejects changed-shape reshape/broadcast and boolean allocation rather than silently downloading pixels. Its documented reshape implementation downloads pixels; native supported-dtype allocation uses create/set on the reference device.

Validation: 111 affected existing/new controls passed (13 unavailable-framework skips), Ruff passed, four native-geometry controls passed on a real GTX1080/CuPy environment, and JAX geometry/reference allocation passed on its installed CPU device. OpenHCS production composition receiving additionally passed mixed intensity, channels, full/channel-free/absent/shared masks and NumPy/CuPy destinations, with GPU downloads forbidden during GPU-only composition. Torch/TensorFlow/Pycles actual-device execution is not claimed. This is a residency/correctness improvement, not a claimed CPU benchmark speedup or full mixed-device pipeline profile.

Release 0.3.7 uses the repository version helper. Original release readiness gates passed 7/7 (real build and Twine metadata validation) in isolated publishing tooling; runtime benchmark dependencies were not modified. Full 239 controls passed (17 unavailable-framework skips), source/scripts Black and mypy passed, full Ruff passed after repairing one existing test import order. Sphinx warning-as-error documentation build passed after fixing two existing release-page title/toctree omissions. The existing trusted tag publisher will publish after main merge; an actual PyPI result remains required.

Closes #7

Copilot AI balanced review requested due to automatic review settings October 6, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@trissim
trissim merged commit ee4c0e9 into main Oct 6, 2026
10 of 14 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.

Keep image geometry and mask allocation in the native framework/device

2 participants