Skip to content

Promote CellProfiler parity and accelerated backends#60

Draft
trissim wants to merge 856 commits into
mainfrom
benchmark-platform
Draft

Promote CellProfiler parity and accelerated backends#60
trissim wants to merge 856 commits into
mainfrom
benchmark-platform

Conversation

@trissim
Copy link
Copy Markdown
Collaborator

@trissim trissim commented Dec 19, 2025

Summary

This PR promotes the CellProfiler compatibility path from benchmark-only smoke execution into a broader OpenHCS runtime compatibility layer with explicit runtime semantics, output equivalence, accelerated backends, parity tracking, and expanded generated-pipeline coverage.

Audit

Runtime and equivalence semantics

  • Adds CellProfiler measurement dialect normalization and equivalence policy wiring.
  • Expands runtime output equivalence for images, tables, measurements, reference artifacts, and cache-aware OpenHCS adapter comparisons.
  • Promotes runtime artifact query/export/value semantics so measurements, object labels, relationships, and image outputs are compared through typed runtime records instead of ad hoc file checks.
  • Adds source-schema workspace and source matching improvements so CellProfiler setup-module semantics map into OpenHCS components without filename smell heuristics.
  • Extends execution validation and runtime cache behavior to separate OpenHCS execution from external equivalence/materialization work.

CellProfiler module compatibility

  • Expands generated .cppipe conversion and binding coverage for alignment, color conversion, image math, mask objects, smooth, enhance edges, expand/shrink, filter objects, classify objects, illumination, object measurements, object relationships, and tracking.
  • Adds typed settings modules for newly covered converter surfaces.
  • Improves module execution handling for object-measurement rows, source-image provenance, object-label domains, stack/slice alignment, and relationship payloads.
  • Fixes per-object measurement semantics where aggregate rows should not be padded as object rows, while preserving dense object-domain completion where required.

Explicit accelerated backends

  • Adds openhcs.processing.backends.cellprofiler modules for alignment, classification, colocalization, illumination, image quality, intensity, intensity distribution, morphology, neighbors, outlines, region properties, relationships, secondary objects, shape, texture, thresholding, tracking, watershed, and Zernike calculations.
  • Adds shared analysis-region-properties backend support.
  • Makes numba a required dependency and declares CellProfiler compatibility extras separately.
  • Keeps backend selection explicit through OpenHCS registry patterns; no silent backend fallback is introduced.

Benchmark tracking and tests

  • Adds a parity runner script for CellProfiler .cppipe suites.
  • Adds tracker docs for full-pass status, parity evidence, and backend optimization work.
  • Expands unit coverage for CP adapters, generated pipeline execution, library loading, module execution, runtime adapter behavior, source schema, symbol table/settings binding, runtime equivalence, artifact queries, runtime values, materialization, morphology, track objects, expand/shrink, measure granularity, intensity distribution, and backend strategy registries.

Verification

Ran with the sibling OpenHCS virtualenv:

../openhcs/.venv/bin/python -m pytest \
  tests/unit/test_cellprofiler_adapter.py \
  tests/unit/test_cellprofiler_generated_pipeline_execution.py \
  tests/unit/test_cellprofiler_library_loading.py \
  tests/unit/test_cellprofiler_module_execution.py \
  tests/unit/test_cellprofiler_runtime_adapter.py \
  tests/unit/test_cellprofiler_source_schema.py \
  tests/unit/test_cellprofiler_symbol_table.py \
  tests/unit/test_cppipe_execution_validation.py \
  tests/unit/test_cppipe_parser.py \
  tests/unit/test_image_file_serialization.py \
  tests/unit/test_materialization_core.py \
  tests/unit/test_runner_cellprofiler_compatibility.py \
  tests/unit/test_runtime_artifact_queries.py \
  tests/unit/test_runtime_equivalence.py \
  tests/unit/test_runtime_execution_validation.py \
  tests/unit/test_runtime_exports.py \
  tests/unit/test_runtime_values.py \
  tests/unit/test_settings_binder.py \
  tests/unit/test_source_matching.py \
  tests/unit/test_source_schema_workspace.py \
  tests/unit/test_cellprofiler_morphology.py \
  tests/unit/test_cellprofiler_processing_backend.py \
  tests/unit/test_cellprofiler_strategy_registries.py \
  tests/unit/test_cellprofiler_trackobjects.py \
  tests/unit/test_expandorshrinkobjects.py \
  tests/unit/test_measuregranularity.py \
  tests/unit/test_measureobjectintensitydistribution.py \
  tests/unit/test_runtime_semantics.py \
  -q

Result:

645 passed, 1 warning in 21.73s

Follow-up Work

  • Extract the .cppipe dialect compiler out of benchmark ownership into a product-facing OpenHCS interop/dialect package so benchmark, CLI, and PyQt consume the same canonical conversion service.
  • Integrate PyQt Code mode with .cppipe loading alongside .py: compile .cppipe into a normal OpenHCS Pipeline, show generated OpenHCS code/form state, and expose source-schema/provenance mapping instead of a black-box CellProfiler runner.
  • Add phase timing records for startup, setup, compile, execute, validation, equivalence, and cache/materialization phases, with graphable long-table output for OpenHCS vs native CellProfiler comparisons.
  • Continue replacing centrosome/scikit-image hot paths with explicit numba/CuPy-capable backend strategies while preserving CellProfiler semantics and avoiding silent fallbacks.

@continue
Copy link
Copy Markdown

continue Bot commented Dec 19, 2025

All Green - Keep your PRs mergeable

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts


Unsubscribe from All Green comments

@trissim trissim changed the title [DRAFT] Benchmark Platform for Nature Methods Paper [DRAFT] Benchmark platform and runtime artifact foundation Apr 25, 2026
@trissim trissim changed the title [DRAFT] Benchmark platform and runtime artifact foundation Promote CellProfiler parity and accelerated backends May 4, 2026
trissim added 30 commits May 19, 2026 13:58
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.

1 participant