Skip to content

Measure 3D shape on prepared label cohorts - #625

Merged
trissim merged 3 commits into
mainfrom
perf/cohort-3d-shape-20261004
Oct 4, 2026
Merged

trissim merged 3 commits into
mainfrom
perf/cohort-3d-shape-20261004

Conversation

@trissim

@trissim trissim commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Default 3-D AreaShape measurement reconstructs a binary bounding-box crop and full Lewiner mesh for every object, alongside separate region-property traversals. The existing shape backend now measures the complete label cohort: one pass captures bounds/counts, and a second collects local moments, cube surface counts and Euler contributions. This removes SurfaceArea3DRegions and its forwarding algorithms while preserving the existing feature mapping and ID/domain conventions.

Unit triangle geometry comes from the installed scikit-image Lewiner algorithm during existing function-family preparation. Runtime spacing scales that geometry without marching again or retaining a per-spacing cache. Both default LEGACY_FAST and NUMBA providers inherit the implementation. Direct unprepared calls and integer-moment capacity limits retain the reference path; advanced measurements retain the required convex-hull calculation. Prepared writable/read-only signatures remain stable.

One public original 3-D baseline/candidate pair completed with all four strict comparisons against two retained native outputs passing. Both sources used the same eight dependencies, original 180 source refs, native binaries, normal registry/kernel READY boundary and default OUTCOMES/RSS observation. Startup, preparation, input acquisition and shutdown are outside the existing public clocks. No repeats, profiling, or new native runs were used.

Observed term Baseline Candidate Candidate minus baseline
Compile (s) 0.937849 0.946201 +0.008352
Execute (s) 5.543015 5.308923 -0.234092
Total (s) 6.743027 6.565815 -0.177212
MeasureObjectSizeShape step (s) 0.455640 0.191921 -0.263720
Peak RSS (MiB) 1504.773 1957.000 +452.227

The shape step demonstrates local production transfer. These are single observations, with substantial other-step variation: a later RescaleIntensity step increased by 360 ms. The pair does not establish a causal whole-pipeline gain or a cause for the higher RSS. The broader runtime and scaling targets remain unfinished.

The timed heads were baseline 47debb48ee81ddedaf1fd54ecdfcde107e34cb34 and candidate b647d4344a0c96418356f318f62e726e189fd967. The immutable local decision, all 31 step deltas, guards, output comparisons and terminal PID/lease checks are retained under shape-main-ab-paired-v2/decision.json. The original prelaunch environment-guard RED is retained separately; it started no server/job. The admitted v2 environment is stored privately and represented by SHA only in the public packet.

After qualification, this branch merged main's grouped-scope metadata fix #623. The focused shape/scope/plate/publication shard passed 29 controls on that integrated source, including all 15 shape controls. Main's later #629 change only updated primary-object docstring/help text and was also merged; the timed evidence remains explicitly tied to the frozen heads above.

The saved Cells/Nuclei replay passed all 17 features and IDs at relative spacing (1.1153846153846152, 1, 1). Integer statistics and Euler match exactly; floating features use the approved absolute/relative 1e-6 tolerance. The largest Cells surface difference, 2.704e-6, passes the combined tolerance and exceeds an absolute-only 1e-6 assertion. The surface control uses the approved relative tolerance; 2-D exactness remains unchanged.

Closes #624

Refs #624. Derive Lewiner geometry during existing family preparation and share the complete feature mapping between cohort measurements and the numerical reference path.
@trissim
trissim marked this pull request as ready for review October 4, 2026 14:03
Copilot AI balanced review requested due to automatic review settings October 4, 2026 14:03
@trissim
trissim merged commit 692978f into main Oct 4, 2026
3 of 37 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Replace per-object 3D shape crops and meshes with prepared cohort geometry

2 participants