Historical Analyzer/Comparison performance architecture

Current authority: R144 WLightCurves architecture.

R114–R133 analytical architecture retained as historical foundation; R144 production authority is WLightCurves.

Production routes

WAnalyzer request
→ immutable prepared plot request
→ resolve_cached_curve_results()
   ├─ local formula results from canonical geometry
   └─ geometry_jobs for missing physical coverage only
→ optional AnalysisJobRunner / QThread
→ transactional geometry commit
→ current formula + current view render

WComparison request
→ established request-scoped AnalysisJobRunner route
→ apparition worker / point batches
→ transactional result commit
→ render

Immutable Qt-free operation boundary

Widget handlers prepare immutable operation data and submit genuine background work to the shared runner. Observation parsing, networking, ephemeris propagation, physical-geometry preparation, formula transformation and process scheduling do not execute inside Qt event handlers.

R123’s PreparedCurveBinding and PreparedAnalyzerPlotRequest remain the exact identity bridge from preparation to result consumption. R133 narrows asynchronous submission so those bindings can be materialized locally when physical coverage already exists.

Canonical physical geometry

WAnalyzer retains Date, T, r, log(r), Δ and raw phase angle as canonical rows. Geometry keys are independent of H0, n, dust parameters and ordinary plotting state. canonical_geometry_key_for_job() resolves the exact reusable geometry entry.

Physical coverage is segmented by comet line, apparition, exact element line and covered T intervals, with the sampling bucket required by the canvas. A formula edit does not discard valid physical segments.

Local formula resolver

  • materialize_cached_curve_result() transforms canonical geometry only when required T intervals and canvas sampling coverage are present.
  • resolve_cached_curve_results() partitions a request into immediate local results and genuine geometry_jobs.
  • The local path does not call compute_curve_jobs(), create a Qt worker or evaluate an ephemeris point.
  • koprobs.ApplyCurveFormula() applies H0 + 2.5 n log10(r), 5 log10(Δ) and the vector dust correction.
  • npfunc.CompositeDustFArray() is the vector form of the unchanged scalar phase equation.

Formula and view state are not physical compute state

Production AnalyzerPlotSnapshot instances no longer capture selected axis, visible limits, return/type/observer filters or Compare state. Compatibility fields are optional only for older QA fixtures.

ChangeExpected work
H0/n or dust inside coverageLocal vector formula transformation.
Phase display mode, axes, filters, Compare, asymmetry viewRender-only selection or masking.
Formula validity extensionOnly uncovered T intervals.
Material canvas refinementOnly missing geometry refinement.
Observation or element revisionNew physical operation; old result is stale.

A view change during a physical operation does not invalidate valid geometry. After commit the renderer uses the current formula and current view.

R179 formula eventExpected work
Editor keystrokeDraft assignment only.
Valid RefreshOne atomic formula commit and one render.
SaveFile transaction only.
AnalyseImmediate typed commit and one render.

Transactionality, stale results and recovery

  • Geometry is committed only after a complete operation succeeds.
  • Cancel, worker failure and incomplete results preserve the previous valid graph.
  • Compute job ID and data/element revision determine staleness.
  • One-shot missing-result recovery invokes the local resolver first and submits only unresolved geometry.
  • R123 completeness validation and exact result-key ownership remain active.

R179 extends transactionality to formula state: invalid intermediate text and invalid Refresh cannot mutate committed formulas; invalid Save cannot change file bytes; Save and Refresh are independent commits.

R154 GUI control overlay

The R131–R149 compute/formula/view transaction remains intact. R154 adds a higher-level immutable control projection so GUI availability reflects current EMPTY/SINGLE/MULTI/BUSY topology without changing scientific compute identity. View-only controls can inspect committed arrays during BUSY; state-changing operations cannot alter the active operation snapshot.

Terminal callbacks re-resolve the current projection and never replay saved widget states.

WComparison boundary

WComparison intentionally retains the established request-scoped route, R121 two-body photometric geometry, point batches and memory geometry. R133 does not change its scientific equations, scheduler contract or rendering semantics.

Release gates

  • analysis_release_gate.py enforces immutable operations, the R133 local resolver, view-independent geometry and transactional commit.
  • modal_ephemeris_release_gate.py enforces the R121 per-widget model/output/scheduler/cache matrix.
  • wplanner_performance_release_gate.py protects Planner boundaries independently.
  • documentation_hygiene.py protects the topic-oriented Markdown layout in CLEAN and QA distributions.

r179_formula_interactive_release_gate.py protects the canonical parser, draft/commit separation and real-Qt interaction path.

QA evidence and limitations

Historical R133 evidence remains 103 passed, 1 skipped, 0 failed, including 8 R133-specific tests.

Auto range, display/style actions and scenario serialization remain outside physical geometry work. Transactional scenario restore may replace workspace state only after complete validation.