Skip to content

Compose invocation image stacks once in their target domain - #1088

Merged
trissim merged 6 commits into
mainfrom
fix/compose-invocation-input-once-20261006
Oct 7, 2026
Merged

trissim merged 6 commits into
mainfrom
fix/compose-invocation-input-once-20261006

Conversation

@trissim

@trissim trissim commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1087

A mixed-memory named image bundle was composed separately for pixels and masks, first in the leading member’s memory domain and then converted to the invocation domain. The CPU identity shortcut could also return an unresolved bundle after composing it. CompiledFunctionInvocation now asks the existing ImagePayloadStackComposition owner once for the declared target/device and passes its concrete result onward. ProducedImageStack retains its canonical cached realization; scalar inputs retain their existing identity path.

Validation: 138 relevant callable, registry, CellProfiler and aligned-payload tests pass, including a CPU named-bundle single-composition control and produced-stack no-copy control. The actual compiled CPU Gaussian → GPU sharpen → skipped CPU → GPU percentile normalization → CPU Gaussian chain on saved microscopy inputs reduces canonical bulk image/mask transfers from 10 / 2,621,440 bytes to 6 / 1,638,400 bytes. Output matches the direct production oracle exactly, masks are exact, checkpoint cache reuse and disk roundtrip pass. GPU→GPU and skipped calls transfer no pixels.

Before receipt: /home/ts/.local/state/openhcs-maintenance/20261006/p5-mixed-scientific-native-abi-v2/receipt.json (5ed8cf). After receipt: /home/ts/.local/state/openhcs-maintenance/20261006/p5-mixed-scientific-compose-once-committed-v1/receipt.json (0d02a57, exact production SHA). Both use the real PatternGroupData.execute_chain owner and ArrayBridge conversion boundaries. This is a transfer census, not timing evidence or CUPTI-wide GPU I/O coverage. Pre-P5 mixed execution failed and provides no complete comparable profile; the final-head plain grayscale negative control also remains unchanged at two bulk transfers / 15,728,640 bytes, with exact oracle and disk/cache checks (/home/ts/.local/state/openhcs-maintenance/20261006/p5-plain-scientific-compose-once-v1/receipt.json, dfb36a1). Full promoted-colour receiving remains unavailable because CuCIM is absent and installed GPU processors require 3D grayscale.

ABI PR #1084 and P5 PR #1080 are merged. This PR targets current main, with its official closing reference to #1087 verified. Its review diff contains only invocation composition, its two controls and the implementation status. Qualified production owner SHAs are unchanged after synchronization.

P0 conversion-profile qualification: the common scratch observer emits isolated convert_input spans through existing RuntimeProfileLogger, draining earlier GPU work before its timer and synchronizing conversion GPU work before stopping it. Exact ABI baseline 5ed8cf and composition head 53edad both complete with unchanged scientific input SHAs, exact output/masks, identical skipped events and checkpoint/disk checks. Retained logs and receipts: /home/ts/.local/state/openhcs-maintenance/20261006/p5-mixed-conversion-profile-{before,after}-v1/. Observed span sums are 4.716ms before and 2.095ms after; this single diagnostic pair establishes the profile gate, not statistical or end-to-end speedup evidence. Common scratch harness SHA: b7a5e3a6fb0ac7d6507e170ac976a16e1405d714cd95c837e093dffc97309d08. No production instrumentation added.

Retain image context for existing registered contract wrappers, and derive native callable arguments through the shared ABI owner. Refs #1083.
Copilot AI balanced review requested due to automatic review settings October 6, 2026 22:36

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 force-pushed the fix/flexible-native-image-abi-20261006 branch from 5ed8cfd to b98c14a Compare October 6, 2026 22:39
@trissim
trissim changed the base branch from fix/flexible-native-image-abi-20261006 to fix/native-payload-domain-composition-20261006 October 6, 2026 22:40
@trissim
trissim changed the base branch from fix/native-payload-domain-composition-20261006 to main October 7, 2026 00:36
@trissim
trissim merged commit e251f31 into main Oct 7, 2026
1 check failed
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.

Compose input image bundles once in the invocation target domain

2 participants