Add zslice variant: scientific + midplane segment-count subagent - #3
Closed
trisha-ant wants to merge 2 commits into
Closed
Add zslice variant: scientific + midplane segment-count subagent#3trisha-ant wants to merge 2 commits into
trisha-ant wants to merge 2 commits into
Conversation
…old stages
Max-intensity projections fuse overlapping body segments, which is the
main reason 1.5fold/2fold/pretzel are hard to tell apart. This variant
runs the scientific classifier, and when that lands on a fold stage it
sends the midplane z-slice to a subagent that counts discrete
body-segment cross-sections (≤1 → 1.5fold, 2 → 2fold, ≥3 → pretzel)
and overrides.
Trigger is deliberately the simplest baseline (primary ∈ fold stages)
so the subagent only ever moves between fold stages, never into or out
of them — count=1 is ambiguous between comma and 1.5fold, so triggering
on comma would systematically push comma frames forward.
Override is recorded in reasoning ("(overrode 2fold)") and in
verification_triggered/phase_count for auditability.
…stages Midplane slice rarely shows >=3 separable cross-sections on pretzel embryos (body folds sit at different z-depths), so the segment-counting subagent systematically downgrades correct pretzel calls to 2fold/1.5fold. Per-stage vs scientific (n=233): 1.5fold: 51.2% (-14.7) 2fold: 59.3% (-1.7) pretzel: 6.8% (-81.2) adjacent: 89.3% (-10.3)
This was referenced Apr 22, 2026
trisha-ant
marked this pull request as ready for review
April 23, 2026 15:53
Owner
Author
|
Subsumed into #5 — all commits are in that branch and the retrospective there covers this variant. |
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.
Stacked on #2 (which is stacked on #1).
Why
The fold-stage accuracy gap (1.5fold ~59%, 2fold ~70%) is the primary bottleneck for autonomous microscopy decisions. When a biologist can't tell the stage from a projection, they scroll z-slices and count body-segment cross-sections at the midplane: 1–2 profiles → 1.5fold, 2 separated → 2fold, 3+ crossing → pretzel. This variant does the same.
What
perception/zslice.py(118 lines), registered aszslice:perceive_scientificon the three-view projection.{1.5fold, 2fold, pretzel}, sendmidplane_b64to a subagent that counts discrete body-segment cross-sections in the single optical slice.≤1 → 1.5fold,2 → 2fold,≥3 → pretzel; override the primary.reasoningand setverification_triggered=True,phase_count=2.Trigger is the simplest baseline (primary ∈ fold stages). It deliberately excludes
comma— segment count=1 is ambiguous between comma and 1.5fold, so a broader trigger would systematically push comma frames forward. The subagent only ever moves between fold stages, never into or out of them.Verification
_accepted_optional_kwargs(zslice)→{'midplane_b64'};scientific→set()(runner correctly routes the slice only to zslice)._segment_count_to_stage: 0→1.5fold, 1→1.5fold, 2→2fold, 3→pretzel, 5→pretzel._parse_segment_counthandles int,"3 segments","two"→None, garbage→None, missing key→None, code-fenced JSON.perceive_zslicelogic: passthrough on comma / no-midplane; override 2fold→pretzel on count=3 with(overrode 2fold)in reasoning; agreement still setsphase_count=2; parse-fail falls back to primary withverification_triggered=True.perception/zslice.py+__init__.py:0 errors, 0 warnings.python run.py --helpexits 0; 16 variants registered.Next
Ablation:
python run.py --variant scientific zslice --stages pretzel 2fold 1.5fold --force(~642 API calls, ~6 min) — not run in this PR.