Repository navigation
Eliminate transient editor states from headless pipeline compilation #596
Description
A single compile-only diagnostic on source a0bb0f4089a85475e112cea32d60132c1cd94752 (now merged into main) after mandatory function-library/kernel READY measured 0.545 s inside ZMQCompilationRequest.compile_fresh. Sibling phases were 0.315 s in pipeline registration/resolution and 0.216 s in axis compilation. Registration constructed nine temporary ObjectState instances (0.295 s inclusive) and produced 18 live/saved snapshots (0.228 s nested). These are diagnostic timings, not unprofiled savings, and nested costs must not be summed.
The compiler retains these editor states only for scope identity and well-filter provenance. The states nevertheless perform live plus saved resolution, dirty/signature tracking, registration/callback and cleanup/graveyard lifecycle. ResolvedPipelineDefinition already owns the admitted steps and can retain those derived scope/provenance facts. Full dataclass analysis and callable preparation together cost under 19 ms; additional registry warmup is not the material route.
Implementation is concrete in the isolated compiler branch based on merged main a3e6a15d49c5ba781bbbeb06f860cb1935fef5d9: remove temporary state registration and cleanup, resolve submitted saved declarations through ObjectState's own shared algorithm, and keep indexed scope identities and same-walk saved provenance on ResolvedPipelineDefinition. The upstream owner extraction merged as ObjectState PR #19; the shared editable dependency now uses ObjectState 1.2.0 at 27d. No new resolver, carrier, cache or editor registry is introduced.
The existing compiler combines saved step values with live provenance. The migration must derive both from the same saved walk. Preserve raw authored PipelineConfig inheritance, saved versus unsaved UI ancestors, enabled-step scope identity, source bindings, constructor validation/effects, callable identity and correlated mutable aliases. Headless admitted values must remain detached from subsequent ancestor edits; existing UI lifecycle remains meaningful.
Acceptance: the existing compiler/axis/path consumers use resolved declarations and their admitted scope/provenance, with obsolete state-map/register/cleanup paths deleted. Meaningful saved inheritance, source isolation, callback/default and mutable-ancestor controls pass. The original saved Speckles request compiles through the actual public READY server using the candidate dependency. Qualify the material runtime payoff with a bounded production comparison after the coherent batch; preserve native measurement/relationship/pixel/inventory parity and existing numerical tolerances. The measured 0.295 s constructor envelope is a ceiling, not promised improvement or the full remaining performance target.
The bounded matched production batch supersedes the older timing gap: baseline Speckles compile/execution/total means are 0.327/0.803/1.289s; candidate means are 0.404/0.830/1.392s. All twelve strict native-output comparisons passed, but candidate total is 0.103s higher. Both sources used the same actual dependencies and independent normally READY servers. No material performance payoff is established; #597 remains draft. The retained-native 1.893s mean implies a 0.947s 2x target, leaving 0.342s baseline and 0.445s candidate total gaps. No fresh native timings, scaling or statistical confidence are claimed.
The remaining compile cost is still large enough to matter, but removing editor lifecycle did not eliminate its dominant shared context/reconstruction/validation work. One bounded public compile-only phase trace will identify that remaining work before any next optimization decision. Architecture, numerical parity and measured runtime remain separate gates. Evidence: /home/ts/.local/state/openhcs-maintenance/20261004/compiler-lifecycle-ab-paired-v1/decision.json.
Trace: /home/ts/.local/state/openhcs-maintenance/20261004/speckles-post-ready-compile-trace-v1/ (compile-profile.json, result.json, decision.json). Implementation PR #597 is formally linked to close this issue and references merged ObjectState PR #19.
Activity
Require ObjectState saved declaration admission API
Pin reviewed ObjectState saved declaration admission
Sync ObjectState pin with latest merged main
Migrate declaration receiving to the resolved pipeline owner