Skip to content

Move generic optimization behavior to runtime owners (#323) - #326

Merged
trissim merged 18 commits into
mainfrom
fix/generic-measurement-runtime-owners-20260930
Oct 1, 2026
Merged

trissim merged 18 commits into
mainfrom
fix/generic-measurement-runtime-owners-20260930

Conversation

@trissim

@trissim trissim commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Store mutations now invalidate their owned query caches, and shared optimization mechanics derive from core owners. Provider-independent object columns, persistent kernel preparation, bounded cache storage/lifetime and the logger-bound profiler move to their shared layer. Numerical keys, algorithms, provider effects and the separate CP module-context profiler retain their domain owners. Obsolete globals, classes and forwarding paths are removed.

The warmed-parent review issue is fixed in ProcessLocalBoundedCache's cooperative subclass hook: each declared subclass owns its singleton and construction lock. Controls cover parent-before-child for plain/registered/identity-bound families, eight-way concurrent child creation, slotted dataclass children, warmed synchronized diamond inheritance, MRO/hook cooperation, LRU eviction and registered cleanup. Four inheritance controls fail before the fix and pass afterward. No consumer workaround or mirror registry is added.

Two source-projection tests also leaked their global microscope configuration into later checkpoint tests. The existing ObjectState GlobalContextValues capture/apply owner now scopes those edits, preserving saved/live projections and absent contexts. Unchanged main passes the checkpoint module alone but fails 2/101 in the specified module order; the corrected broad sequence passes with strict original address/pixel/calibration assertions. This fixes #336 without changing microscope admission or fabricating HTD metadata.

Latest production f7b39a2a4 includes main f24a828da and exact dependency pins, including PolyStore 84f322e. The final documentation commit has an identical production/dependency/benchmark/script/test tree. 1,538 local tests and 42 subtests pass, with one existing optional Napari skip and two unchanged watershed warnings. Original CI-pinned R0 and original NRA R1 pass without increases; complete ClassDef census retains 5,129 declarations, 5,117 projected and all 12 OPEN. Repeated complete native-reference qualification passes 30/30, every difference_count=0, on this latest production source. Existing 1e-6 numerical tolerances and exact discrete/identity/declared-image checks remain.

Matched ordinary ABBA timings identify prior synced production 68aed451f / main 8c512d404; they are not relabeled as newer-source timings. ImagingFlow mean execution is 14.482s main / 14.573s branch and total 16.682s / 17.126s, including a 0.354s compilation increase. Advanced segmentation execution is 9.442s / 8.999s and total 12.386s / 12.101s. These small samples do not establish neutrality or a general speedup. The residual ImagingFlow total difference is retained for performance work under #162; the latency target is not claimed complete.

Current validation, ownership and reproduction and its authenticated evidence archive contain exact recipes, source/pins, main and warmed-parent negative controls, local XML, original guards/census, final native observations/generated pipeline sources/measured receipts and all ordinary timing samples. Prior guarded NRA movements are separate from authored semantic behavior. Removed private import paths remain an explicit external dynamic boundary.

Ready-server startup/shutdown are excluded from pipeline clocks. Mandatory registry/kernel preparation precedes clocks, and tests/audits/builds/replays do not overlap timed pipelines. Native scientific outputs are retained references; old native clocks are not fresh speedup evidence. Native/scaling figures and performance grinding continue under #162.

Fixes #323. Fixes #336.

@trissim
trissim marked this pull request as ready for review October 1, 2026 01:25
Copilot AI balanced review requested due to automatic review settings October 1, 2026 01:25

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.

@trissim

trissim commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Concrete inheritance/new-case failure in the touched shared lifetime owner; please pick this up in the existing PR rather than a competing patch. On exact main b31807d and PR head 3417e36: define ParentCache(ProcessLocalBoundedCache), obtain ParentCache.process_cache(), store a parent-only value, then define ChildCache(ParentCache) and obtain ChildCache.process_cache(). Both revisions return the same ParentCache instance (actual type ParentCache), and ChildCache sees the parent-domain value. This violates the declared one-singleton-per-concrete-subclass contract; it predates this PR, so I am not calling it an introduced regression. The new lock does not fix inherited _process_cache identity. Current tests cover sibling isolation/one-leaf concurrent construction but not warmed-parent extension. Please fix declaration identity in the shared lifetime owner, preserve cooperative MI/MRO, concurrency, bounded values and registry cleanup, with parent-before-child and diamond behavior controls; no consumer workaround or new mirror registry. Original read-only exact-source reproducer failed as expected in 83ms/9.9M, retained at /home/ts/wt/openhcs-issue-batch-20260929/runtime-cache-review-20261001/reproduce_subclass_identity.py and original-reproduction.log. Existing PR326/issue323 owner keeps source ownership; parent is tracking review closure. No native/science/runtime slot or installed environment changed.

@trissim
trissim merged commit 3569105 into main Oct 1, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants