Skip to content

Wait for every camera of a sequence before reporting missing images - #1

Merged
jseguiguren merged 1 commit into
mainfrom
fix/multi-camera-sequence-end
Nov 5, 2026
Merged

jseguiguren merged 1 commit into
mainfrom
fix/multi-camera-sequence-end

Conversation

@jseguiguren

Copy link
Copy Markdown
Owner

Fork-internal draft for the fix in scapecontrol's DEVIATIONS D-80, so the AcqEngJ test workflow runs on it. Upstream (micro-manager/AcqEngJ) gets an issue and a PR only after a rig run with the patched jar confirms it (scapecontrol bench/README.md, "Confirming the AcqEngJ fix"). The issue text is drafted in scapecontrol's docs/upstream/acqengj-multi-camera-sequence-end.md.

What happens: Engine.acquireImages gave up when the buffer was empty and isSequenceRunning() was false. Without an argument, that call asks only about the Core camera. In a hardware sequence on two cameras, the other camera can still be delivering its last frame after the Core camera has finished. The engine then threw "Expected images did not arrive in circular buffer", and the frame arrived just after.

This was seen with LightSheetManager on two PVCAM Kinetix cameras: 2 of 2004 volumes in one overnight run, each time with one image left in the buffer and both cameras stopped.

Fix: check isSequenceRunning(camera) for every camera of the sequence, before the buffer count. A camera inserts its last image before it reports that it stopped, so the order matters. Side effect: a camera that stays running and never delivers now makes the loop wait where it used to throw; the event's timeout (micro-manager#141) or an abort ends it, as it already does for a single camera.

Test: TestMultiCameraSequenceEnd is native-free and runs on RecordingCMMCore.

  • On 9f46e53 it fails with the rig's exact error.
  • With the fix it passes, and a second test checks that a frame that never arrives is still reported.
  • mvn test: all 14 tests pass locally.

Generated by Claude Code

acquireImages gave up when the buffer was empty and the Core camera had
stopped (isSequenceRunning() with no argument). With a sequence on two
cameras, the other camera can still be delivering its last frame after the
Core camera has finished; the engine then threw "Expected images did not
arrive in circular buffer" and the frame arrived just after.

Check isSequenceRunning(camera) for every camera in the sequence, before
the buffer count (a camera inserts its last image before it reports that it
stopped). Seen with LightSheetManager on two PVCAM Kinetix cameras: 2 of
2004 volumes failed this way in one overnight run, each time with one image
left in the buffer and both cameras stopped.

A camera that stays running and never delivers now makes the loop wait where
it used to throw; the event's timeout or an abort ends it, as for one camera.

TestMultiCameraSequenceEnd reproduces the error with a native-free fake
core and checks that a frame that never arrives is still reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XvXpWXe3X8gdDpsE66ocY
@jseguiguren
jseguiguren marked this pull request as ready for review November 5, 2026 10:02
Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:02
@jseguiguren
jseguiguren merged commit 099bf5c into main Nov 5, 2026

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 insufficient remaining quota. Try requesting a review at a lower effort level.

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.

3 participants