Skip to content

DynaCell v1.1 application - #534

Merged
alxndrkalinin merged 72 commits into
mainfrom
dynacell-v1.1-application
Nov 4, 2026
Merged

alxndrkalinin merged 72 commits into
mainfrom
dynacell-v1.1-application

Conversation

@alxndrkalinin

@alxndrkalinin alxndrkalinin commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Second of three stacked PRs that replace #494. This one ports applications/dynacell from dynacell-models (8e74a7e) without the Spotlight v2 experiments. #533 (shared packages) is merged (squash 4a4ac9ff); this PR now targets main, with main merged in at d074562f.

  • PR-A: shared packages, root, CI, lock.
  • PR-B (this PR): DynaCell v1.1: benchmark configs, evaluation pipeline, launcher, tools, lite benchmark, 2D track, HF demo, docs. 1,825 files, +128k/−8.9k against PR-A.
  • PR-C: Spotlight v2 arms, eval buckets and tools. It is based on this branch.

After all three merge, main is the DynaCell dev line and dynacell-models stays frozen as the paper-cited snapshot.

Review guide

  • Most of the size is generated YAML. configs/ is 1,522 files (+73k). The leaves come from the generators (tools/generate_*), and guard tests pin them: test_benchmark_config_composition, test_evaluate_compose, test_paths, and the generators' own *_test.py. Review the generators and the guard tests, not each leaf.

  • Code (src/, tools/, tests/) is 274 files, +53k/−4k, of which src/ is +28k. It is a verbatim copy of dynacell-models except the trim commits listed below.

  • Commit layout:

    1. 81a74c92 configs, verbatim;
    2. cdbfcfc6 code, verbatim;
    3. lock, marker, CI and CLAUDE.md;
    4. the four trim commits (e0be4c68, d4277d86, 898e2e14, 9cee1166) and the /code-review fixes (6cb538e6, d86c682f, 76e307f8, 769cb04c, eb9dc300, f21ed1e8, b96ae3f7). These are the only hand edits to DynaCell files;
    5. merges of Port shared VisCy package changes from DynaCell v1.1 #533's review fixes (50f9fe1f, ec725171, d3dc0ce8, 0b07f26c, a04b3eb5);
    6. the live-tree fix for the grouped walk and audit (97c30a1e..8ebca438, see below).
    7. d7986fde deletes seven finished one-shot tools and their tests (path-migration trio, deconv re-tokenizer, NaN-MicroMS3IM scan, instance-AP codemod, joint-leaf smoke), raised in review by edyoshikun. Full suite after it: 5251 passed, 0 failed.

    Review them as a diff against dynacell-models: git diff origin/dynacell-models HEAD -- <file>.

Engine hooks (default off)

engine.py, celldiff_wrapper.py and mask_conditioning.py are exactly as on dynacell-models. The three LightningModules keep the Spotlight training hooks (seg_aux, seg_consistency, mask_mode, target_bg_lowpass):

  • every hook defaults off, and bit-identity tests in test_training_integration.py guard that (e.g. test_unet_seg_aux_none_is_bit_identical_to_the_base_path, test_flow_matching_bg_lowpass_off_is_bit_identical_with_fg_mask_in_the_batch);
  • only Spotlight leaves (PR-C) turn them on;
  • a hook-free engine never existed at any commit, and two DynaCell-paper 2D checkpoints (pix2pix2d_unetvit_wmatch, fcmae_vscyto2d_scratch_samplematched) store seg_aux_weight in their hparams, so they could not resume against a hook-free class.

Behavior change for Spotlight v1 users: fg_mask is re-binarized > 0.5 before it reaches SpotlightLoss.

Trim edits (the only differences from dynacell-models besides the missing Spotlight files)

git diff --stat origin/dynacell-models HEAD lists 794 files (the live-tree fix changed lines inside the generator files listed below; no new file):

  1. tools/generate_grouped_eval_configs.py (e0be4c68, refined in 6cb538e6, 769cb04c, eb9dc300, f21ed1e8):
    • drops the ARMS import from the Spotlight leaf generator and the Spotlight names from _CODE_TO_PAPER / _DETERMINISTIC_MODELS / _CELLDIFF_MODELS. It keeps the four 2D *_seed1 replicates the 2D appendix scores.
    • The canonical prediction tree is shared and still holds the arms' stores. One predicate, is_foreign_model_dir, picks out a dir whose model paths.PAPER_KEY knows while this generator neither parses it nor lists it in _CODE_TO_PAPER. walk_predictions and the instance-AP coverage audit both skip those dirs before parsing, and the walk prints the count. Without this, parse_zarr_name raises on the first arm (unknown CellDiff variant 'segaux_iterative').
    • Everything else still raises (walk) or is flagged (audit), as on dynacell-models: an unknown dir, or a _CODE_TO_PAPER model that does not parse (the wmatch dirs).
    • MEASURED on the live tree, the audit's error set is identical to dynacell-models' (102 entries, compared path by path).
    • _match_model_variant is now the single model-dir acceptance rule; _split_model_variant wraps it with the same errors.
    • Tests cover the skip, both raises and walk/audit agreement. PR-C keeps the filter.
  2. tests/test_benchmark_config_composition.py, tests/test_paths.py (d4277d86): drop the v1 *_spotlight leaf entries, the Spotlight members of the wide-GPU and long-wall sets, and the two test_paths tests that import the Spotlight generator or need the grouped generator to register the arms.
  3. 40 {nucleus,membrane}/{fnet2d,celldiff_2d,fcmae_vscyto2d_scratch,pix2pix2d_unetvit}_seed1 leaves (898e2e14): the header pointed at generate_spotlight_v2_leaves.py, which is not in this PR. It now says what the leaves are for. The change is comments only. PR-C restores the generated header, because that generator's test pins each leaf byte for byte.
  4. evaluation/README.md, tests/test_evaluate_compose.py (9cee1166): no longer list the Spotlight eval generator.
  5. tools/generate_instance_ap_eval_configs{,_test}.py (eb9dc300): the audit applies the same is_foreign_model_dir skip, with a test that has one registered, one foreign and one unknown store.
  6. evaluation/paths.py, tests/test_paths.py (b96ae3f7): comments only. They no longer cite tools/generate_spotlight_v2_leaves.py, which this branch lacks, and the Spotlight model names stay. PR-C restores the original text.

Moved from PR-C to here (76e307f8, verbatim):

  • tests/test_seg_consistency_{training,focus}.py. They test this PR's engine hook and focus rule with a stand-in segmenter.
  • src/dynacell/mask_conditioning.py, which engine.py and celldiff_wrapper.py import.

Kept on purpose: the Spotlight model names in evaluation/paths.py (PAPER_KEY etc.) and the test_paths tests of those names. canonical_model_name resolves by longest prefix, so without these names an arm's run dir (fnet2d_segaux) would silently resolve onto its baseline (fnet2d).

Root changes on top of PR-A

  • uv.lock: dynacell-models' lock verbatim, which this tree's pyprojects match (uv lock --check exit 0). Against PR-A it moves cubic 0.7.0 → 0.9.0a4 and adds dinov3 (pinned commit), mlcroissant, rdflib, etils, submitit and others. A fresh uv lock would float dinov3 to its current HEAD.
  • pyproject.toml: drops the requires_data marker PR-A registered, since its only user (main's grouped-generator test) is replaced.
  • pyproject.toml: re-adds the applications/dynacell/examples/hf_demo pytest path, for build_demo_data_test.py.
  • test.yml: the dynacell job gets back test_submit_benchmark_batch and the eight test files PR-A left out. Like PR-A, it no longer repeats the four viscy-utils test files that the new test-utils job runs.
  • CLAUDE.md gets the hung-job / stall-watchdog / wall-limit runbook.

Live-tree fix for the grouped eval walk (FOLLOWUPS #1)

On dynacell-models, walk_predictions() and the instance-AP coverage audit fail on the live prediction tree.

Before the fix (MEASURED):

  • the walk raised unknown train_set token 'ipsc_final';
  • the audit returned 102 errors.

This PR now handles every known non-canonical dir explicitly. Anything else still raises.

  • Parsed, sibling-only: pix2pix2d_unetvit_wmatch{,_seed1} (56 stores). _CODE_TO_PAPER already declared them a parse-only registration, but _DETERMINISTIC_MODELS lacked them. The committed *__2d_focus2d_pix2pix2d_wmatch buckets score them. _SIBLING_ONLY_MODELS keeps them out of the canonical grouped buckets and the instance-AP leaves; the walk still returns them, so sibling buckets can be built from it.
  • Skipped, with a count:
    • _CHECKPOINT_REPREDICTS: 12 (organelle, model, train set) triples, 34 stores. These are checkpoint variants from the voxel-matched FNet-2D and sample-matched UNeXt2-2D ablations (ipsc_step8400, ipsc_step11k, ipsc_step200k, ipsc_final, ipsc_repredict). Hand-written experiment buckets score them, and no committed config references them.
    • _FOREIGN_MODEL_DIRS: the three P1 segcons replicate dirs (12 stores). Neither registry nor PAPER_KEY knows them.
  • The walk and the audit share one rule (skip_reason). Guard tests check that every _CODE_TO_PAPER model parses and that the skip lists stay disjoint from the registries.

After the fix (MEASURED on the live tree, 1,148 stores):

  • the walk completes: 684 parsed, 378 foreign-skipped, 34 re-predicts skipped, 25 R1 CellDiff skipped, 27 on out-of-scope test sets;
  • the audit returns 0 errors.

Regression proof (MEASURED, both generators run the default way, without --out-root or a filter):

  • 0 wmatch blocks in any canonical {org}_{train_set} bucket or instance_ap leaf.
  • The canonical pool main() buckets (628 stores) is identical, store by store, to what the pre-fix rules parse. Bucketing and emission code is unchanged, so a default regeneration writes exactly what the pre-fix generator would have written if its walk had not crashed.
  • The committed leaves are still not byte-identical after a default regeneration, for a pre-existing reason. They were frozen under DON'T-FOLD before the 2D, ablation and brightfield stores existed, so the regeneration adds 492 blocks from stores the pre-fix rules also parse.
  • Every committed condition block is reproduced verbatim. Filtered to the committed conditions, all 16 canonical leaves are byte-identical.

Known limits

  • The SegConsistencyLoss docstring names dynacell.cellpose_dense, which arrives with PR-C.

Tests

Local runs: pytest -n 8 on an A40 node, in this branch's own venv (uv sync --all-packages --all-extras --frozen: cubic 0.9.0a4). The root addopts deselect slow.

Suite Result
applications/dynacell -k 'not test_combined_ddp' 4100 passed, 134 skipped, 0 failed (at 8ebca438; one earlier run at that head failed test_ssim_real_cubic_2d_and_3d_identical_scores_one, which depends on test order; it is pre-existing and unchanged from dynacell-models)
packages/ 1219 passed, 1 xfailed, 0 failed

Composition guard runs 0 Spotlight leaves. test_benchmark_config_composition.py collects 1,773 tests here, and 0 of their ids match a Spotlight arm token. The same regex matches 705 of 2,478 ids on PR-C, so the check can tell the two apart. The only fnet3d_vscyto3daug ids are nucleus/fnet3d_vscyto3daug, the DynaCell patch-vs-augmentation ablation.

Lint: the pre-commit hooks pass on every commit.

CI: green on d074562f after the retarget (29 checks pass, 1 skipped).

Merging main (d074562f). #533 landed as a squash while this branch carried its commits only up to 0b1cb979, so four files conflicted against the pre-#533 merge base. test.yml, root pyproject.toml and uv.lock keep this branch's side (main's copy equals #533 at 0b1cb979, which this branch only adds to; uv lock --check passes); applications/dynaclr/tests/conftest.py takes main's side (#533's pandas infer_string fix; this branch never touched it). Every merged file equals this branch's copy where it changed the file and main's otherwise. Full repo pytest -n 11 at d074562f: 5269 passed, 0 failed, 138 skipped, 1 xfailed.

Review triage and follow-ups are recorded with the split (/code-review triage per finding, and a FOLLOWUPS list of the issues that are pre-existing on dynacell-models).

🤖 Generated with Claude Code

alxndrkalinin and others added 30 commits October 26, 2026 15:47
Port the Spotlight-motivated losses from dynacell-models so they live
in the shared package before any application consumes them:
SegAuxDice (seg_aux.py) with the SAUNA-map and soft-clDice weight maps
(seg_aux_maps.py), the segmenter-consistency loss (seg_consistency.py),
the Track H background low-pass target (background_lowpass.py), and
SpotlightLoss(return_components=True). Defaults keep SpotlightLoss's
existing behavior; no package imports an application.

Source on dynacell-models: 40de793 (#498), 6c28a31 (#521),
0cbeda1 (#524), 050f553 (#530).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the Spotlight fg-mask recipe from dynacell-models.
generate_fg_masks now binarizes a CLAHE-equalized, 5^3-median-filtered
volume at an Otsu threshold picked on that volume after a sigma=5
Gaussian; compute_otsu uses the same full-resolution smoothing, so the
otsu_grid_spacing parameter is gone from generate_normalization_metadata
and VisCyTrainer.preprocess. The median and Gaussian run through cubic
on the GPU when cubic and a device are present, else SciPy; cubic stays
an optional import. torch is imported lazily so that light callers of
write_meta_field do not pay for it.

Behavior change: Spotlight masks and Otsu thresholds written by
`viscy preprocess` differ from main's.

Source on dynacell-models: 40de793 (#498), d087d96 (#510).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rite-once

Port the HCSPredictionWriter and prediction_metadata work from
dynacell-models:
- z_reduction="center" and z_planes (slab-only predicts write only the
  planes they predicted, and record them);
- per-FOV completion markers and the checkpoint/settings identity that
  predict resume and the eval caches key on (prediction_metadata.py);
- refuse writes into an existing store when a FOV outside the run has
  unmarked prediction channels, or when the array would grow;
- assemble each volume in memory and write it once on a background
  thread (bytes unchanged);
- raise NotImplementedError when trainer.world_size > 1, instead of
  letting ranks race on one store.

Source on dynacell-models: 2b848a6, 1be4466, 74fa18a (#497),
8e41498 (#511), 996adb4 (#526), 6c83fff (#531), 8e74a7e (#532).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the training guardrails from dynacell-models. VisCyCLI now
injects, on every `fit`:
- a latest-weights ModelCheckpoint that owns last.ckpt (the monitored
  checkpoint gets save_last=False), so last.ckpt always means the
  latest epoch, inheriting the leaf's write cadence;
- MonitorHealthCheck, which raises when the monitored metric is
  non-finite or bit-identical for 10 validation epochs;
- OptimizerHealthCheck, which raises after 5 consecutive non-finite
  losses or on GradScaler collapse.
Also adds the opt-in LinearLRCooldown callback and raises the CLI
subprocess test timeout to 120 s (it timed out on main).

Behavior change: this applies to cytoland, dynaclr and dynacell fits.

Source on dynacell-models: 20e54db, daa7477, bc0f444, 74fa18a
(#497), 92693ae, 2f9ef31 (#528).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port two viscy-utils changes from dynacell-models:
- ssim_25d / ms_ssim_25d: clamp the variances, bound the covariance by
  Cauchy-Schwarz through a safe sqrt, floor the stability constants
  symmetrically, and run MS-SSIM outside autocast, so 16-mixed training
  cannot NaN the gradient. SSIM/MS-SSIM loss values change slightly for
  MixedLoss users.
- viscy_utils/__init__ resolves its exports lazily (PEP 562), keeping
  torch and lightning off light import paths.

Source on dynacell-models: a556bc9 (#484), 130e034, cee4e41,
272051c, 59343ad, 8b2413f (#509).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asks

Port the viscy-data side of the dynacell-models predict and Spotlight
work:
- HCSDataModule.predict_z_planes and SlidingWindowDataset z_planes /
  read_z_planes, so a 2D model predicts only its focus slab;
- cache_volume: with num_workers == 0 predict reads each (position, t)
  volume once and, when every transform is pointwise, normalizes it
  once;
- foreground masks are read in their stored dtype (uint8) and cast to
  float on the device in on_after_batch_transfer.

Behavior change: every app's predict at num_workers=0 takes the
read-once path.

Source on dynacell-models: 40de793 (#498), 996adb4 (#526),
6c83fff (#531), 8e74a7e (#532).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hannels

Port from dynacell-models:
- patch_size may be a per-axis (z, y, x) tuple through the patch
  embedding, transformer unpatchify and ViT bottleneck, which lets
  CELLDiffNet run Z-preserving at Z=1 for the 2D track (an int is still
  accepted);
- CELLDiffNet(cond_channels=1) adds extra conditioning input channels
  (default keeps the old single-channel net).

Source on dynacell-models: 0126fe6, 0617ed7, 40de793 (#498).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the time_schedule option of the CellDiff ODE integrators from
dynacell-models: uniform (default, unchanged), cosine, or a Beta(p, q)
grid packed toward the data end, which is what lets the DynaCell-lite
recipe sample in 14 velocity evaluations. scipy joins the celldiff
extra for betaincinv.

Source on dynacell-models: 19765e7 (#520).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port MorphEmModel from dynacell-models, the fifth deep-feature
extractor of the DynaCell evaluation. transformers is imported lazily
and the trust_remote_code model is pinned to a Hub commit.

Source on dynacell-models: d3f6422 (#479), 4918d2e, 13cb336,
c9c6914.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port preserve_z from dynacell-models, so the 3D PatchGAN runs on Z=1
inputs for pix2pix2d (default off, unchanged).

Source on dynacell-models: c2d0481.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port from dynacell-models:
- UNet3D(downsample_z=True): False keeps Z through the encoder, which
  is how FNet2D runs on single planes (default unchanged);
- UNet3DBase.forward raises on non-5D input, and a comment flags the
  ConvTranspose checkerboard artifact.

Source on dynacell-models: a556bc9 (#484), 83a1d69, 16b1d31.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port 9640537 from dynacell-models: a size-1 spatial axis (Z=1 for 2D
models) gets an identity row in the affine, instead of being resampled
off the volume and zeroed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NormalizeSampled and MinMaxSampled set pointwise = True, which lets the
read-once predict path in viscy-data normalize a whole volume once
instead of once per window.

Source on dynacell-models: 8e74a7e (#532).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ministic

Port 3409560 (#513) from dynacell-models.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port dfcf9a5 (#512) from dynacell-models: pytest-xdist joins the test
group, and a root conftest.py pins OMP/MKL/OpenBLAS to one thread under
each xdist worker. Without the pin every worker's torch sizes its pool
to all cores, which made `-n 11` 10x slower than it should be and timed
out subprocess tests. CLAUDE.md documents the usage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the marker half of c50300f (#489) from dynacell-models.
strict_markers = true turns an unregistered marker into a collection
error, so a typo'd marker can no longer silently decorate nothing.
hpc_integration moves from the cytoland and dynaclr conftests to the
root: an addinivalue_line registration only holds when that conftest
is in the invocation's ancestry. dynaclr drops its own testpaths so
the root ini applies.

requires_data is registered too: main's
applications/dynacell/tools/generate_grouped_eval_configs_test.py uses
it, and strict markers would otherwise drop that module at collection.
(dynacell-models no longer uses the marker; the dynacell PR that
follows removes the registration with it.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the root half of 7b7cb43 (#523) from dynacell-models so the HF
demo's tests import its app module. The directory already exists on
main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port d1ea492 from dynacell-models. The orchestrated linear-classifier
fixture joined on the first fov_name component, which failed 7 tests
on main once pytest collects dynaclr's colocated *_test.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the cytoland recipe comment fixes from 40de793 (#498): the
preprocess flags take explicit values (`--compute_otsu true
--compute_fg_masks true`), fg_threshold and nonzero_threshold are inert
while fg_mask_key is set, and the Otsu-centred target is what makes 0
the FG/BG boundary. Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the tutorial fix from d3f6422 (#479): cytoland and viscy-utils
are not on PyPI yet, so the tutorials install them from the GitHub
monorepo; their siblings resolve from PyPI. Adds the jupytext-paired
notebooks (no outputs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port 93ac234 from dynacell-models: drop the repo-layout tree, setup
and common-command blocks, lint/docstring rules (pyproject.toml is the
source) and the generic coding-philosophy sections. The DynaCell job
runbook from the same file arrives with the dynacell PR, since it
documents tools that only exist there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
viscy-utils had no CI job on main or on dynacell-models: four of its
test files ran inside the dynacell job and the rest (losses, metrics,
meta_utils, optimizer health, CLI, lazy imports) ran nowhere. Mirror
the viscy-data job on ubuntu-latest for Python 3.12 and 3.13, and make
the gate job wait for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the test-dynacell-configs job from dynacell-models, minus the
eight test files that only arrive with the dynacell PR: sync
viscy-utils' test group with dynacell, and add test_submit_benchmark_batch,
test_engine, test_pipeline_cache, feature_metrics_test and the
viscy-utils prediction-writer, prediction-metadata, monitor-health and
LR-cooldown tests. The dynacell-models PR target is not carried over.

Source on dynacell-models: 33d2fee, 74fa18a (#497), 2d1ed32 (#506),
4450efd (#518), 2798dee (#519), 2f9ef31 (#528).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start from dynacell-models' uv.lock and re-resolve with `uv lock`
against this tree, whose applications/dynacell/pyproject.toml is still
main's. Against dynacell-models' lock this drops the ten dynacell-only
packages (dinov3, etils, ftfy, jsonpath-rw, mlcroissant, pandas-stubs,
ply, rdflib, submitit, termcolor) and resolves cubic back to 0.7.0;
the dynacell PR restores them. Against main's lock it adds pytest-xdist
and moves boto3/botocore 1.43.0 -> 1.43.20, cellpose 4.1.1 -> 4.2.1.1,
pyarrow 19.0.1 -> 24.0.0, s3transfer and tracksdata; torch and
lightning are unchanged. `uv lock --check` exits 0 (main's own lock
does not).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port every DynaCell config path of dynacell-models verbatim: the model
leaves (baselines, A549/joint/HEK/brightfield, the 2D track with its
seed replicates and warmup-matched refit, the temporal and
patch-vs-augmentation ablations, CELL-Diff-R2 and the DynaCell-lite
leaves), the grouped and instance-AP eval buckets of the paper models,
the shared overlays, train/predict sets and launcher profiles, and the
deletion of 155 stale config files. The leaves are generated; review
the generators and guard tests in the code commits, not each leaf.

Spotlight v2 arm leaves, their four fit overlays and their 231
spotlight_v2_* eval buckets are left out; they follow in their own PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port every DynaCell code path of dynacell-models verbatim (226
non-merge commits since 2026-06-16; PRs #479-#530): the evaluation
pipeline (cpdino/MorphEm/focus-aware 2D, focus2d slab metrics,
foreground-limited metrics, MicroMS3IM, scale-invariant pixel metrics,
CP shared space, provenance and cache invalidation), the paths
registry, preprocessing/registry/croissant/distribution, the launcher
and stall watchdog, the lite benchmark and CELL-Diff fast inference,
the 2D track, the HF demo, docs, and the engine, celldiff_wrapper and
mask_conditioning modules exactly as on dynacell-models.

The three LightningModules keep their Spotlight training hooks
(seg_aux, seg_consistency, mask_mode, target_bg_lowpass). Every hook
defaults off, the bit-identity tests guard that, and only Spotlight
leaves turn them on; two DynaCell-paper 2D checkpoints store
seg_aux_weight in their hparams, so a hook-free engine could not
resume them. mask_conditioning.py comes along because engine.py and
celldiff_wrapper.py import it.

The files that import the Spotlight leaf generator are trimmed in the
commits that follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Take dynacell-models' uv.lock verbatim, which this tree's pyprojects now
match (`uv lock --check` exits 0). Against the shared-packages lock it
moves cubic 0.7.0 -> 0.9.0a4 and adds dinov3 (pinned commit), etils,
ftfy, jsonpath-rw, mlcroissant, pandas-stubs, ply, rdflib, submitit and
termcolor. A fresh `uv lock` would instead float dinov3 to its current
HEAD and bump mlcroissant/pandas-stubs, so the verbatim lock keeps the
versions the paper evaluations ran with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its only user was main's generate_grouped_eval_configs_test.py, which
the DynaCell port replaced: the live-data tests there are now marked
slow. With strict markers, nothing needs the registration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore the eight dynacell test files the shared-packages PR left out
of the test-dynacell-configs job, now that they exist:
test_evaluation_microssim_calibration, segmentation_test,
test_distribution, test_croissant, test_main_cli_routing,
test_evaluation_fid_provenance, provenance_test and
watch_stalled_jobs_test. The job now matches dynacell-models'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the DynaCell job runbook of the root CLAUDE.md from dynacell-models
(6193b9c, bcbfbe6, c4c5ed0, 74fa18a #497, e1d75cf): how to tell a
finished-but-hung job from healthy compute by the CPU-time derivative,
the stall watchdog (tools/watch_stalled_jobs.py), per-family predict
and fit wall limits, and the forensics to capture before cancelling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alxndrkalinin and others added 6 commits October 26, 2026 22:34
…walk

The live tree holds second-checkpoint predictions of registered models
beside their canonical stores, under train-set dirs paths.py does not
know: fnet3d_paper/ipsc_step{8400,11k}, fnet2d_voxelmatched/ipsc_step200k,
fcmae_vscyto{2d_scratch_samplematched,3d_scratch}/ipsc_final and
fcmae_vscyto3d_scratch/ipsc_repredict (34 stores). key_from_prediction_store
raises on them ("unknown train_set token 'ipsc_final'"), which stopped
walk_predictions and filled the instance-AP audit. They come from the
voxel-matched FNet-2D and sample-matched UNeXt2-2D ablations, are
scored only by hand-written experiment buckets, and no committed config
references them, so they are not canonical inputs. Each
(model dir, train-set dir) pair is now listed in _CHECKPOINT_REPREDICTS
with its campaign; the walk skips and counts them and the audit skips
them. A train-set dir that is neither canonical nor listed still raises.

Fixes part of FOLLOWUPS #1 (live-tree walk crash).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nucleus/pix2pix2d_unetvit_segcons_{s1,ctrl_s1,x10} (12 stores, Spotlight
P1 follow-ups of 2026-10-19) sit in the canonical tree but are in
neither this generator's registry nor paths.PAPER_KEY, so the
PAPER_KEY-based foreign test cannot see them and they raised "unknown
model code-name". They are now listed by name in _FOREIGN_MODEL_DIRS
and skipped like the PAPER_KEY arms; the skip message no longer says
"PAPER_KEY". Any other unknown dir still raises. The new audit test
holds one store of each kind on the live tree (registered, checkpoint
re-predict, named foreign, wmatch, unknown train set) and expects only
the unknown one to be flagged.

Fixes the rest of FOLLOWUPS #1 (live-tree walk crash).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_CHECKPOINT_REPREDICTS matched (model dir, train-set dir) in every
organelle, so a future mito/fnet3d_paper/ipsc_step8400 store would have
been skipped as a known re-predict instead of raising, though only the
ER one exists. Entries are now (organelle, model, train set) triples
for exactly the stores on the live tree; a listed token in another
organelle raises "unknown train_set token" again (new test, fails
before this change). The audit test now uses the nucleus step-11k
store, since the step-8400 one is ER-only.

Found by /code-review on the FOLLOWUPS #1 fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
walk_predictions and audit_prediction_coverage each called
is_foreign_model_dir and is_checkpoint_repredict inline, so a third skip
category added to one could silently miss the other and split them
again. Both now call skip_reason(zarr_path), which names the category;
the walk counts per category. No behavior change.

Found by /code-review on the FOLLOWUPS #1 fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lass

Two guards on the hand-kept registries behind the live-tree crash:
- every _CODE_TO_PAPER model must parse. At a04b3eb this lists
  pix2pix2d_unetvit_wmatch{,_seed1}, the omission that stopped
  walk_predictions;
- the name-based skip lists stay disjoint from what the campaign
  registers: no _FOREIGN_MODEL_DIRS entry in _CODE_TO_PAPER or the
  parse tuples (it would be dropped silently, since the foreign check
  runs first), and no re-predict token among the canonical train sets.

Found by /code-review on the FOLLOWUPS #1 fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The organelle-scoping edit left a broken line wrap in the
_CHECKPOINT_REPREDICTS comment. Comment only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alxndrkalinin added a commit that referenced this pull request Oct 27, 2026
Brings in #534's fix for the walk/audit crash on the live prediction
tree (FOLLOWUPS #1): wmatch registered for parsing, the listed
checkpoint re-predicts and the named P1 segcons replicate dirs skipped
with counts, one skip rule for walk and audit, registry guard tests.
Resolution in generate_grouped_eval_configs.py: dynacell-models'
Spotlight registrations and _SPOTLIGHT_ARM_MODELS stay, with the
wmatch entries and _FOREIGN_MODEL_DIRS added beside them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alxndrkalinin
alxndrkalinin requested a balanced review from Copilot October 27, 2026 05:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The changes require final human review because they are too complex or risky for automated approval.

No open issues 🎉

Review effort: Balanced

… leaves

Registering pix2pix2d_unetvit_wmatch{,_seed1} for parsing (97c30a1)
fixed the live-tree walk, but a default regeneration would then also
fold their 56 stores into the canonical {organelle}_{train_set}
buckets and the instance-AP leaves, against DON'T-FOLD: the committed
*__2d_focus2d_pix2pix2d_wmatch buckets are where they are scored.
They are now listed in _SIBLING_ONLY_MODELS: walk_predictions still
returns them, so sibling buckets can be built from it, but main()
buckets canonical_predictions() (the walk minus that list) and the
instance-AP in_scope() drops them. New tests: canonical_predictions
leaves them out, in_scope rejects them.

MEASURED on the live tree, both generators run the default way (no
--out-root) emit 0 wmatch blocks, and the canonical pool (628 stores)
is identical, store by store, to what the pre-fix rules parse, so a
default regeneration writes exactly what a04b3eb would have written
had its walk not crashed.

Found by /code-review on the FOLLOWUPS #1 fix (finding 2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alxndrkalinin added a commit that referenced this pull request Oct 27, 2026
Brings in #534's fix that keeps pix2pix2d_unetvit_wmatch{,_seed1} out
of the canonical grouped buckets and the instance-AP leaves on a
default regeneration. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alxndrkalinin
alxndrkalinin requested a balanced review from Copilot October 27, 2026 06:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The changes require final human review because they are too complex or risky for automated approval.

No open issues 🎉

Review effort: Balanced

alxndrkalinin and others added 3 commits October 29, 2026 11:29
…r framework

The camera-ready title is now "Evaluating Dynamic 3D Virtual Staining
of Live Cells with DynaCell": DynaCell names a broader framework for
image-based profiling of cell-state dynamics, and this paper's
evaluation framework is part of it. Update the title in CITATION.cff
(software and preferred citation), the README and both HF card BibTeX
entries, and the Croissant citeAs string; rewrite the CITATION.cff
abstract and the README tagline to describe the evaluation framework
as part of DynaCell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015kuht3npKtb2o5E6h19xbA
Mirror paper 1c85e84: "This evaluation framework is part of DynaCell, a
broader framework" repeated the noun. The paper's contribution is now
the DynaCell evaluation suite, and DynaCell stays the broader framework.
The CITATION.cff abstract also says "a set of baseline models", so
"suite" means one thing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015kuht3npKtb2o5E6h19xbA
The paper's title is now "The DynaCell Evaluation Suite for Dynamic 3D
Virtual Staining of Live Cells" (Overleaf b73f25f). Updates
CITATION.cff, the README and HF card BibTeX, and the Croissant citeAs.
test_croissant.py: 17 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015kuht3npKtb2o5E6h19xbA

@edyoshikun edyoshikun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a pretty solid and huge PR with most of the changes being the addition of the all the config files + tests.

Not sure how much you plan to reuse things but the /tools/*.py has a bunch of stuff.

Otherwise LGTM!

Base automatically changed from viscy-packages-from-dynacell-v1.1 to main November 3, 2026 18:45
alxndrkalinin and others added 2 commits November 3, 2026 10:54
#533 was squash-merged as 4a4ac9f while this branch carried its
commits only up to 0b1cb97, so the merge base is pre-#533 main and
four files conflicted:
- .github/workflows/test.yml, pyproject.toml, uv.lock: main's copy
  equals #533 at 0b1cb97 and this branch only adds to it, so this
  branch's side is kept (uv lock --check passes);
- applications/dynaclr/tests/conftest.py: unchanged here since
  0b1cb97, so main's side is taken (the pandas infer_string fix).
No file changed on both sides after 0b1cb97, and every merged file
equals this branch's copy where it changed the file, else main's.
Full suite (pytest -n 11): 5269 passed, 0 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzpgExfYMKCgogfnhcSgDc
Each did a one-time job that is done, and nothing else imports them:
- build_migration_manifest, run_migration, restandardize_config_paths
  (+ tests): the canonical-path migration was applied 2026-07-13; a
  rebuilt manifest on 07-24 had nothing left to move;
- retokenize_deconv_predictions (+ test): the 24 a549__deconv /
  joint__legacy_deconvgt renames were applied 2026-07-22; paths.py
  still reads both tokens for the dirs kept on purpose;
- scan_nan_microssim_caches (+ test): one audit for the cubic 0.9.0a1
  NaN MicroMS3IM caches that #506 fixed;
- add_instance_ap_to_ablation_leaves: one codemod, already applied;
- smoke_joint_leaf: an April CPU smoke the config-composition tests
  now cover.
The provenance builders (cpdino seg masks, HEK stores, A549 dual fuse,
random-init checkpoints) stay. README entries and one bake_best_ckpt
docstring line follow. Full suite: 5251 passed, 0 failed (the 18
fewer are the two deleted tests/ files; the 14 colocated tool tests
were never collected by the root run).

Raised in review by edyoshikun.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzpgExfYMKCgogfnhcSgDc
@alxndrkalinin

Copy link
Copy Markdown
Collaborator Author

@edyoshikun thanks for pointing out the leftovers in tools, it cleaned it up

@alxndrkalinin
alxndrkalinin merged commit 7286fb2 into main Nov 4, 2026
30 checks passed
@alxndrkalinin
alxndrkalinin deleted the dynacell-v1.1-application branch November 4, 2026 16:21
alxndrkalinin added a commit that referenced this pull request Nov 4, 2026
#534 was squash-merged into main as 7286fb2. This branch stacked on
#534 but stopped six commits short of its final head (d7986fd): the
paper retitle, the #533 squash merge, and the deletion of the finished
one-shot tools. Merging that head first keeps the real ancestry, so the
following merge of main resolves against #533's squash commit instead
of the pre-split base. None of these six commits touches a file this
branch changes, and no file here references a deleted tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01APoGhoKfkCho9Z1VMS5jsG
alxndrkalinin added a commit that referenced this pull request Nov 4, 2026
main's tree equals #534's final head (d7986fd) byte for byte, and the
previous commit merged that head here, so every one of the 47 conflicts
(the 40 generated 2D seed1 leaves, evaluation/paths.py and README, the
grouped generator and its test, test_paths, test_evaluate_compose,
test_benchmark_config_composition) resolves to this branch's side. They
are the trims #534 made that this PR reverts. The merge leaves the
tree unchanged: the PR's diff against main is byte-identical to its
previous diff against its #534 base (772 files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01APoGhoKfkCho9Z1VMS5jsG
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