Repository navigation
Reuse exact Costes thresholds across object sets in one step - #186
Merged
Merged
Conversation
trissim
marked this pull request as ready for review
September 29, 2026 13:35
trissim
changed the base branch from
codex/perf-fast-completion-poll
to
main
September 29, 2026 17:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
The advanced and beginner segmentation tutorials repeat Costes threshold calculation for identical image-pair pixels across object sets. A real 1w_1t profile found 180 object-colocalization calls but only 40 distinct selected-pixel pairs; threshold work took 3.999 seconds. The image payload is rebuilt between object sets, so its identity cannot safely identify reusable thresholds.
This change shares thresholds for one FunctionStep invocation. The existing Costes batch authority now keys exact selected-pixel content plus method, scale, and backend selection; the CellProfiler module executor passes the step-owned value to each object measurement. The cache is released at the step boundary and is absent from compiled parameters. The separate batch executor metadata issue #176 remains open.
Closes #185. Stacked on #183.
Evidence
benchmark/results/perf_coloc_step_cache_20260929/.Validation follow-up: the shared CellProfiler test context now supplies one runtime step value per type, matching the production context used by the Costes cache. This fixes the previously failing composed-image runtime-adapter test; the test passes in this PR checkout.