Repository navigation
B1: stack every z-plane before 3D processing - #1181
Merged
Merged
Conversation
Two defects together sent a 2D image into a full-stack callable, so the z-planes were never stacked. 1. A plain callable that takes main-flow pixels as its primary argument (assemble_stack_cpu) treated its stored context input (positions) as the owner of its group scope. CallableContract.group_scope_inputs defaulted to every artifact input when no group-lineage relation was declared, so the runtime domain became ARTIFACT_MANAGED and select_lifecycle_anchors kept one anchor: only z001 was assembled. Such a callable's group scope is now owned by the main flow (main_flow_supplies_primary_image); adapter-managed and relation-declared callables are unchanged. 2. Since d092a03 (PR #394) a one-member cohort whose producer declared no plane axis was passed whole, while the same member in a larger cohort is stacked on the runtime-slice axis. The rank a callable received depended on how many files matched. Before #394 the lone member got a leading axis, which hid defect 1. Now keeps_single_member_whole is the one rule for the load path and for the producer's stack cache: only a persisted whole image, or a member carrying its declared axis, stays whole. test_main also checked plate metadata against a rule that #134 (8224363, in #394) changed on purpose: result-only directories are published with an empty raster inventory. The check now accepts a subdirectory declared as a results_dir. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
test_main passing (12/48): disk-{ImageXpress,OperaPhenix}-direct-{none,fiji}, disk-OpenHCS-direct-{none,fiji}, disk-{ImageXpress,OperaPhenix}-zmq-{none,fiji}. All 48 failed on main before this fix. |
This was referenced Oct 10, 2026
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.
Symptom
test_main[disk-ImageXpress-3d-multiprocessing-direct-none-none](and everytest_maincase) failed withcreate_projection: input must be a 3D array, got 2Din step 6 (second Z-Stack Flattening).Bisect
First-parent bisect from fc1f946 (good, 2026-09-24): first bad is a3e6a15, merge of PR #394 (shared runtime plumbing). Inside #394 the first observed bad commit is d092a03 "preserve whole-image domains across main-flow handoff". Its parents are hidden by a separate test_main failure (see 3).
Root cause (two defects; the first predates #394)
CallableContract.group_scope_inputstreated every artifact input as the owner of the group scope when the callable declared no group-lineage relation.assemble_stack_cpu(image_tiles, positions)therefore got runtime domainARTIFACT_MANAGED, andselect_lifecycle_anchorskeptanchors[:1], so only the first z-plane was assembled. This dates from ccfef5f (July). Before Consolidate runtime execution, producer and projection ownership #394 it was hidden because the loader always gave the lone z001 file a leading axis, socreate_projectionreceived (1,H,W).Fix
CallableContract.main_flow_supplies_primary_imageis true when the callable takes main-flow pixels as its primary argument and no adapter manages its artifact inputs. Such a callable's group scope is owned by the main flow. Adapter-managed and relation-declared callables are unchanged.ImagePayloadStackComposition.keeps_single_member_wholeis the one rule for both the load path (from_loaded_images) and the producer stack cache (with_saved_output_context). Only a persisted whole image (volume domain), or a member that carries its declared axis, stays whole. No case is special-cased for Z.aligned_image_payload.py, one predicate used in two places. Please carry it through the payload refactor.3. Stale test_main check (not a production bug)
#134 (8224363, in #394) publishes result-only directories with an empty raster inventory on purpose.
test_mainrejected that, so it now accepts a subdirectory declared as aresults_dir.Tests
test_stored_context_input_beside_main_flow_image_keeps_every_anchor, plus a one-member variant of the RGB cohort reload test. The opaque-domain expectations now load a lone member without a plane axis as(1, …)on RUNTIME_SLICE.test_opaque_main_flow_image_domain.pyandtest_function_patterns.py: 119 passed. Across the 7 related unit files, the 9 failures that remain also fail on main.cp_tutorial_3d_monolayer, "No image serialization format is registered for suffix '.pkl'").Out of scope, found here
Zarr conversion output has no declared source projection(zarr-OpenHCS, step 0), and the zarrresultsmetadata entry lacksimage_files/available_backends/microscope_handler_name.Timed out waiting 30000ms for Napari ack on port 5555, andMetadataWriteError: Saved images lack typed produced addresses.B1 · PR #1181 · guards n/a (bug fix) · production −9 +50 · tests −9 +62
🤖 Generated with Claude Code