Skip to content

build(dynacell): pin cubic 0.9.0a3, measured equivalent to 0.9.0a2 - #515

Merged
alxndrkalinin merged 3 commits into
dynacell-modelsfrom
build/cubic-090a3
Sep 30, 2026
Merged

alxndrkalinin merged 3 commits into
dynacell-modelsfrom
build/cubic-090a3

Conversation

@alxndrkalinin

Copy link
Copy Markdown
Collaborator

Three commits:

  1. The pin check accepts measured-equivalent versions. Eval venvs import dynacell from the shared VisCy tree, and check_cubic_pin required an exact match, so any pin bump reaching that tree killed every eval still queued on the previous venv. It now accepts the declared version or anything listed under it in CUBIC_VERSIONS_EQUIVALENT_TO, the same measured equivalence the final-metrics cache gate already trusts. The cache gate treats that set as one class. Anything outside the class is still refused: verified that the 0.8.0a2 cpdino-eval venv is REFUSED while the 0.9.0a2 and 0.9.0a3 venvs pass.
  2. The pin moves to cubic 0.9.0a3, with 0.9.0a2 and 0.9.0a1 listed as equivalent. The lock moves only cubic (2efdeb0e → b4fb1406).
  3. run_eval_direct.slurm defaults to cpdino-eval-cubic090a3. That venv is the 0.9.0a2 venv's package set with only cubic changed (a one-line pip freeze diff).

Equivalence, measured on real data. Two A549-trained fnet3d_paper a549__denv pairs, ER and nucleus, FOV 0/0/fov0000, 7 + 10 timepoints, production eval.yaml and spectral_pcc/base.yaml kwargs, on an A40:

Columns Max abs Δ
All pixel columns (PCC, SSIM, NRMSE, PSNR, SI_*), XY/Z FSC, FRC_Resolution, Spectral_PCC 0
Control: binomial + resample_isotropic single-image FSC (never used in production) 1.8–6.1% relative

The control moves, so the comparison can see a change. The harness's 0.9.0a2 values also match the production pixel_metrics.csv (PCC/FSC within 4.4e-16). 0.9.0a3's new sampling-floor RuntimeWarning fires only in the non-production single-image FSC in spectral_pcc/evaluate.py, and never in compute_pixel_metrics. Scripts and outputs are in experiments/2026-09-30_cubic090a3_equivalence/ (gitignored).

Tests.

  • applications/dynacell on the 0.9.0a3 venv: 3909 passed, 0 failed, 171 skipped (-n 11).
  • provenance_test.py: 21 passed on the 0.9.0a3 venv, and 20 passed + 1 skipped on the 0.9.0a2 venv (the declared-version test skips there by design).
  • The two new tests fail on the old provenance.py.

🤖 Generated with Claude Code

https://claude.ai/code/session_015kuht3npKtb2o5E6h19xbA

alxndrkalinin and others added 3 commits September 30, 2026 13:33
… pin check

check_cubic_pin required the installed cubic to equal the declared pin
exactly. Eval venvs import dynacell from the shared tree, so a pin bump
reaching that tree killed every eval still queued on the previous venv
at startup, even when the bump was measured to move no value.

The pin check now accepts the declared version or any version listed
under it in CUBIC_VERSIONS_EQUIVALENT_TO -- the same measured
equivalence the final-metrics cache gate already trusts. The cache gate
treats that set as one class: a cache matches when recorded and
installed are equal or both in the class, so an equivalent venv also
reuses the declared pin's caches. Versions outside the class are still
refused, and a newly declared pin with no measured entry still accepts
only itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015kuht3npKtb2o5E6h19xbA
cubic 0.9.0a3 changes single-image FSC/FRC only: it judges the split
sampling floor per direction, splits binomial counts before isotropic
resampling, and warns below the 2.83 x pixel-size floor. Production's
two-image FSC/FRC in compute_pixel_metrics is untouched.

Measured on real data (A549-trained fnet3d_paper ER + nucleus a549__denv,
FOV 0/0/fov0000, 7 + 10 timepoints, production eval.yaml and
spectral_pcc/base.yaml kwargs, A40): every pixel column, XY/Z FSC,
FRC_Resolution and Spectral_PCC are bit-identical between 0.9.0a2 and
0.9.0a3. The binomial + resample_isotropic control moves 1.8-6.1% under
the same harness, so the comparison can see a change. 0.9.0a2 and
0.9.0a1 are listed as equivalent, so their caches stay reusable and
venvs holding them still pass check_cubic_pin.

The lock moves cubic only (2efdeb0e -> b4fb1406).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015kuht3npKtb2o5E6h19xbA
cpdino-eval-cubic090a3 is the cpdino-eval-cubic090a2 freeze with only
cubic changed (pip freeze diff: one line). Jobs already queued on the
0.9.0a2 venv keep running, since 0.9.0a2 is listed as equivalent.

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

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.

Copilot review overview

🟢 Approval recommended

The pin, lockfile, launcher, provenance logic, documentation, and tests are consistent.

Review effort: Balanced
Findings: None

What changed in this PR

Pins Dynacell to cubic 0.9.0a3 while preserving compatibility with measured-equivalent versions.

Changes:

  • Updates cubic dependencies and evaluation environment.
  • Extends provenance checks and cache reuse across equivalent versions.
  • Adds tests and documentation for equivalence behavior.
File Description
uv.lock Locks cubic 0.9.0a3.
applications/​dynacell/​pyproject.toml Updates eval and preprocess pins.
applications/​dynacell/​tools/​run_eval_direct.slurm Selects the 0.9.0a3 evaluation environment.
applications/​dynacell/​src/​dynacell/​evaluation/​provenance.py Implements equivalent-version acceptance and cache matching.
applications/​dynacell/​src/​dynacell/​evaluation/​provenance_test.py Tests equivalent environments and cache reuse.
applications/​dynacell/​src/​dynacell/​evaluation/​CLAUDE.md Documents the updated numeric contract.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@alxndrkalinin
alxndrkalinin merged commit 095ccbb into dynacell-models Sep 30, 2026
27 checks passed
alxndrkalinin added a commit that referenced this pull request Sep 30, 2026
…fy branch

#515 widened the cubic check in metrics_provenance_matches to an
equivalence class; this branch had already moved the prediction stamp
into the same function. Kept both: the class check, then the digest
check. The only textual conflict was the Returns docstring.

#515's new test_equivalent_environment_reuses_the_declared_pins_cache
called the gate without prediction_sources, which this branch makes
required; it now passes _SOURCES, matching the _DIGEST that
_stamp_cubic writes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XvkM1gKifWmoDPq8Drd4JF
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