[Design] what remains of #40 in pipekit-cycle, now that vardax owns 4D-Var

Aperta
#165 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
design

Direzione di ricerca

Read #40, the design snapshot in this issue, and packages/pipekit-cycle/docs/ to understand the existing proposals and ADR conventions. Compare the two ownership options, then record the decision and consequences here and add an ADR; if the decision creates follow-up work, open and link those feature issues. Done means the decision is recorded, the ADR exists, and any needed follow-ups are linked.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:code priority:p2 question

4 Nov 2026 · J. Emmanuel Johnson

Problem / Question

Which of the contracts proposed in #40 should still ship in pipekit-cycle, now that part of it has landed and vardax implements 4D-Var itself?

Recommended: treat #40 as finished once AdjointObservationOperator is settled, and leave every variational driver and covariance contract in vardax.
Alternative: add the variational protocols to pipekit-cycle, so that a second algorithm library can interoperate with vardax without depending on it.
Status: open.

User Story

As a maintainer, I want #40's scope to match the code, so that the issue doesn't imply work that the design has moved elsewhere.

Motivation

#40 was written before BFNCycle, the adjoint specs and the added protocols landed.
Its checklist no longer describes what is left.
Report 10, which audits pipekit-cycle, doesn't mention FourDVar, CostFunction, Minimizer, ObservationWindow, NudgingStep or gaspari_cohn.

Design Snapshot

State of #40's proposals at 7c446f1 (packages/pipekit-cycle/src/pipekit_cycle/):

#40 proposed At this pin
TangentLinearModel Ships in protocols.py
ForwardBackwardCycle, NudgingStep Replaced by BFNCycle in bfn.py
Adjoint checkpointing primitive Ships as declarative specs in adjoints.py (RecursiveCheckpointAdjoint and others), with the SupportsAdjoint protocol
ControlVectorTransform Partly covered by ReducedBasis (operg, prior_inv, nbasis), which has no transpose
AdjointObservationOperator Absent
CostFunction, Covariance, Minimizer Absent
Innovation, ObservationWindow Absent; align_observations in the OSSE epic covers window selection
FourDVar Absent from pipekit; vardax ships StrongFourDVar, WeakFourDVar and IncrementalFourDVar
gaspari_cohn, gaussian_kernel, matern_kernel Absent

vardax's decision D8 (docs/design/decisions.md in jejjohnson/vardax) has its seven model classes satisfy pipekit-cycle's protocols directly, through .as_analysis_step().
Under that decision a variational solve is one AnalysisStep, and the cycle doesn't need to see its cost function.

Proposed Options

# Option A (recommended): vardax owns the solve; the cycle sees an AnalysisStep
# today (pipekit-cycle), not pinned (vardax)
cycle = pc.DACycle(forward, obs_op, vardax.StrongFourDVar(...).as_analysis_step(),
                   obs_source=obs_source, n_steps=10)
# Option B: pipekit-cycle names the variational contracts and a driver
# proposed (#40)
cycle = pc.FourDVar(forward, obs_op, background=x_b, B=B, R=R,
                    minimizer=ScipyMinimizer("L-BFGS-B"), n_steps=10)

Alternatives Considered

  • Option A. Pro: no new surface, one owner for variational numerics, and pipekit-cycle stays algorithm-agnostic. Con: another library has to choose its own names for Covariance and Minimizer.
  • Option B. Pro: shared names across algorithm libraries. Con: two owners for the driver, and a contract with only one implementer.
  • Keep #40 open as it is (rejected). Its checklist can't be completed as written.

Three small items are independent of the choice, and need one line each in the decision: AdjointObservationOperator, a transpose on ReducedBasis, and the localisation kernels, which may belong in a numerics library rather than here.

Decision

Open.

Consequences

Under Option A, #40 closes as completed and the remaining names are dropped.
Under Option B, #40 is replaced by feature issues for each protocol and the driver.

References & Existing Code

  • #40, which holds the full proposal and the MASSH audit.
  • docs/design/pipekit_composition.md and docs/design/decisions.md in jejjohnson/vardax.

Implementation Steps (post-decision)

  • Record the decision in packages/pipekit-cycle/docs/ as an ADR.
  • Close or replace #40 accordingly.

Definition of Done

  • Decision and Consequences written into this issue.
  • ADR entry added.
  • Follow-up feature issues opened and linked, if any.

Testing

  • N/A; the decision adds no code.

Documentation

  • The ADR.

Relationships

  • Parent (theme epic): #148
  • Blocks: #40
  • Related: jejjohnson/vardax
Lingua principale
Python
Stelle
0
Fork
0
Merge medio
3h 50m
PR unite (30g)
143

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jejjohnson/pipekit

Tutte le issue di jejjohnson/pipekit

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.