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

Open
#165 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
design

Research direction

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.

Written by the indexing model from the issue text.

Description

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
Dominant language
Python
Stars
0
Forks
0
Avg merge
3h 50m
Merged PRs (30d)
143

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jejjohnson/pipekit

All issues in jejjohnson/pipekit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.