Skip to content

[Sad Catapella B9][Performance infrastructure] Add reproducible end-to-end and kernel benchmarks before Numba acceleration #106

Open

Description

@guijacquemet

Basis

Sad Catapella Batch 9, source d7a538e56d41ac1093ba79adcad397c21b3dfd32. Confirmed benchmarking infrastructure gap, not a measured performance regression; no benchmarks were run or code modified.

Evidence

Proposed benchmark framework

A versioned benchmarks/ directory with pinned input generator, seed, baseline commit, Python/NumPy/SciPy/Zarr/Numba versions, hardware/core/thread count, dtype, image and chunk geometry, compression, compiler warmup, and tabular results. Run metrics: wall time, CPU time, peak RSS, allocation volume, storage reads/decompressed bytes, and throughput (pixels/s or images/s). Profile first with production code (e.g. py-spy/scalene/cProfile and memory profiling), do not assume Numba improves C-backed NumPy/SciPy.

Tier 1 — mask kernels: 512²/4096²/16384² (the largest only if resources allow), 1–10^5 objects, contiguous/sparse int32 label IDs, fragmented objects, 1/2/4/8/12 mask types, T/Z >1, realistic label adjacency; independent oracle and bit-exact evidence JSON. Compare existing SciPy, algorithmically improved NumPy and optional njit union-find/streaming overlap. Include cold JIT and warm repeats, single and multi-thread controls. Require deterministic tie-breaking and no uint32/uint64 coercion.

Tier 2 — data pipeline: whole TIFF, tiled TIFF, compressed TIFF, NGFF 2/3, block vs whole, chunk boundary mismatch, 256/65536 bins, 1k–100k FOVs, 1–8 channels, no-change and 1% changed re-runs, filesystem metadata count and CSV memory, simulated fault + concurrent writers for correctness.

Tier 3 — QC/UX: 5/50/500/5000 FOV per biological repeat, 2–20 biological repeats, unequal FOV counts, 1–8 channels, threshold edits and channel switching. Normalize performance comparisons to identical scientific decision policy; normalization code/benchmarks belong in its repo.

Acceptance

  • Produce scripts/reports that compare specified existing and candidate implementations on the same persisted fixture and pin commit hashes; avoid speed claims without confidence intervals and repeats.
  • Verify exact count/identity and numerical tolerances independently before performance acceptance; assert invalid data remains rejected, tests pass and peak RSS meets limits.
  • Define a documented threshold for accepting JIT complexity only after baseline measurements (e.g. worthwhile warm-runtime improvement with no unbounded compile/wheel burden), maintain a pure NumPy/SciPy fallback only as an explicitly selected identical-semantics backend, not a silent scientific fallback.
  • Benchmark PR PP-2: remove convert_tiffs, zarr_export, the moved-name shims and the old axis functions #66 post-merge architecture rather than optimizing deleted conversion code. This issue covers shared benchmark infra and should not replace each algorithm's specific issue.

No tests, benchmarks or speedups have been executed or measured.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions