Skip to content

Fix flaky processing-screen test and close the deferred minors from the 3-D metrics and native 3-D files work - #145

Merged
mbel-tech merged 10 commits into
mainfrom
fatina-del-codice/beautiful-hypatia-wlxfol
Oct 11, 2026
Merged

mbel-tech merged 10 commits into
mainfrom
fatina-del-codice/beautiful-hypatia-wlxfol

Conversation

@mbel-tech

@mbel-tech mbel-tech commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

What and why

Two things on this branch.

1. Flaky test fix (tests/test_ui/test_processing_screen.py::test_no_rebuild_after_shutdown, failed ~1 run in 12). The _hold_lane helper returned as soon as its holder task was submitted. If TaskRunner.shutdown() cancelled everything before the pool thread had started it, the holder was cancelled while still queued and reported "cancelled" without ever holding the lane, so two tasks were cancelled and waitUntil(len(cancelled) == 1) timed out. The helper now returns only once the holder is running. Test-only; 0 failures in 150 runs afterwards.

2. Deferred minor fixes from the reviews of the 3-D metrics (B2) and native 3-D files (A) work, executed from docs/superpowers/plans/2026-10-11-deferred-minors.md. No metric value, exported file or project_hash changes for pixel, fused or existing native projects.

  • Native readers (Anipose, DLC-3D): headers are read whole, not cut at 64 KB, in the scan, the readers and the unreadable-format notice (with a hard cap); the keypoint choices are the union across scanned files; the DLC-3D reader has its own error codes (DLC3D_*) and "DeepLabCut 3-D" wording instead of borrowing the 2-D reader's; a duplicate DLC-3D column is refused; consistent naming.
  • Session / pipeline / engine guards: keep_animals warns when it drops a mismatched raw_z; the fuse() refusal names the real condition; identity-switch correction warns when a session with z has several animals; the unused Session.pixel_size_known is removed; t2d add names the unreadable file; add_session refuses a bare native folder up front (NATIVE_3D_NEEDS_OPTIONS, since a native file needs unit and fps and a bare add could never read it) and keeps the pre-probe mixing check for pixel folders in a native project.
  • Wording / CLI / docs: the water-column reason says "calibration settings" on the console (CLI-only; README, logs and Metrics screen keep the neutral text); t2d list-metrics has a footer pointing to t2d validate; t2d add --yes prints a check: line for proposed options such as unit=mm; docs/METRICS_SPEC.md documents the native-project unavailability of IL-3/IL-9/IL-10/IL-14 and the group metrics.
  • Metric log noise / tests: the per-session depth-scale skip warning is aggregated to one line per run and reason, and GL-16 gets zero-animal / zero-frame regression tests (last commit of this branch; this description is updated when it lands).

Not included, on purpose: counting a gap separator row as a frame (GL-1/GL-16; changes 2-D numbers), the body_length_cm zero-length convention, IL-17's per-bin vertical-speed estimate, the Anipose real-sample contract case (fixture unreachable), and regenerating guide screenshots.

Test plan

  • Flaky test: 0/150 failures after the fix (2/25 and 1/7 before).
  • Per task: tests written first with RED recorded; each task reviewed and re-reviewed; full suite run by reviewers on the intermediate heads: 4359 passed, 191 skipped (Task 2) and 4367 passed, 191 skipped (Task 3), QT_QPA_PLATFORM=offscreen pytest -q -W error::RuntimeWarning.
  • ruff check . and mypy (CI versions) clean.

Checklist

  • Tests added or updated (written before the fix)
  • ruff check . passes
  • Docs updated if behaviour changed (docs/METRICS_SPEC.md)
  • CHANGELOG.md entry under [Unreleased]
  • Guide screenshots regenerated: not applicable (no screen changed)

🤖 Generated with Claude Code

https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp

test_no_rebuild_after_shutdown failed about 1 run in 12. _hold_lane returned as soon as the
holder was submitted; if shutdown() cancelled everything before the pool thread had started it,
the holder was cancelled while still queued and reported 'cancelled' without ever holding the
lane, so two tasks were cancelled and the test (which expects exactly the one dropped build)
timed out waiting for len(cancelled) == 1. The helper now returns only once the holder runs.
0 failures in 150 runs afterwards.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp
…iles)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp
…rrors, refuse duplicate columns

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp
…onsistent DeepLabCut 3-D wording

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp
keep_animals warns when it drops a mismatched raw_z; the fuse() refusal names the
missing pixel frame; identity-switch correction warns that z is not re-labelled;
Session.pixel_size_known (unused) removed; t2d add names the unreadable native file;
ProjectStore.add_session runs the native mixing/unit pre-check before listing when the
folder's reader is detectable.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp
A bare add cannot supply the required unit/fps, and a reader-less entry was counted as a
pixel session by the project rules; refuse with NATIVE_3D_NEEDS_OPTIONS pointing to the
scan/confirm step or t2d add. Design doc: new fuse refusal wording.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp
…e project before listing

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp
…log path too

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXpnhJcJvaj5BxqfESMHNp
@mbel-tech mbel-tech changed the title Fix flaky test_no_rebuild_after_shutdown (wait for the lane-holding task to run) Fix flaky processing-screen test and close the deferred minors from the 3-D metrics and native 3-D files work Oct 11, 2026
@mbel-tech
mbel-tech marked this pull request as ready for review October 11, 2026 10:41
@mbel-tech
mbel-tech merged commit f37430d into main Oct 11, 2026
7 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.

2 participants