Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

argminax's skill shelf: a small strategy library that stands on optimistix

Design · the skill tree for a library whose floor is mostly third party

1Decision

Recommended: argminax’s shelf is nine use skills and two extend skills over three units, with one listed skill, and its floor is three cards: two of gaussx’s and a substrate card for optimistix, which this page drafts. Alternative: no shelf, only one skill, because the library has 31 public names; that loses the three cards its future dependents need. Status: open, 12 Nov 2026.

What does not change: argminax’s public API and its two contributor skills, add-solver and add-diagnostic. argminax has no use skill today. This page follows the pattern of gaussx’s shelf and says only where argminax differs.

2Motivation

argminax is small, new, and extends another library’s protocols, so most of what a caller must know is not in argminax.

Table 1:argminax’s public names by unit, at the submodule pin. The public API lives in five public modules, solve, adjoint, curvature, diagnose and blr; the package root exports only the exceptions.

UnitRungsHome bandSubpackagesNames
Solvers and adjoints② ④MLargminax.solve 14, argminax.adjoint 4, argminax.exceptions 3, argminax 122
Curvature⓪ ③numerics, MLargminax.curvature 77
Diagnostics④MLargminax.diagnose 66
Bayesian learning rule② ④MLargminax.blr 1212
All47

Table 2:Which part of argminax each dependent package uses.

Dependent packageNames usedSolvers and adjointsCurvatureDiagnosticsBayesian learning rule
vardax65100
pyrox-nn30120
pyrox-gp22000
pyrox-lgm22000
pyrox-ssm22000
plumax10100

Four packages import argminax at the pins of this commit. vardax takes five names of the solvers and adjoints, subclassing KStep, and one of the curvature; pyrox-lgm takes laplace_mode and its result; pyrox-nn takes the Laplace curvature and two diagnostics; plumax takes one curvature name. Its AGENTS.md @ c7bd0c3 names the consumers that are to switch over: vardax, radtrax, plumax, pyrox-gp, pyrox-lgm, pyrox-nn and gaussx. The table fills in as their pins move, and the test fails until the page is regenerated.

3The shelf

Table 3:argminax’s shelf. Each use skill is one file; the extend skills exist today in .claude/skills/.

RoleSkillCoversModule
⓪ structureCurvature operatorsgauss_newton and low_rank, returned as gaussx operators with their PSD tagcurvature
② strategyGauss–Newton with an inner CGGaussNewtonCG, as a solver passed to optimistixsolve
② strategyAdjoints for a solve stopped earlyKStep, OneStep, to_optimistix_adjointadjoint
② strategyPositivity and boundsReparametrisedsolve
② strategyadd-solverextend
③ modelThe Laplace approximationLaplace, marginal_variance, push_forward, sample_by_perturbationcurvature
④ algorithmFinding the modelaplace_mode, its covariance and site forms, and their resultssolve
④ algorithmDual-form solvesdual_solve, incremental_dual_solvesolve
④ algorithmRetrieval diagnosticsaveraging_kernel, degrees_of_freedom, information_contentdiagnose
④ algorithmEvidence and the prior precisionevidence, optimize_prior_precisiondiagnose
⓪ ④add-diagnosticextend: a curvature operator or a diagnostic

argminax has no ① of its own. Its AGENTS.md puts the boundary in one line, “one step is gaussx’s; the loop is argminax’s”: the verbs are gaussx.newton_update and gaussx’s solves, and argminax iterates them.

4Units and cards

Table 4:The cards each dependent package would receive from argminax. Only vardax receives one at these pins.

Dependent packageCardsAlso uses
vardaxSolvers and adjoints (subclasses KStep)Curvature (1)
pyrox-nnnoneCurvature (1); Diagnostics (2)
pyrox-gpnoneSolvers and adjoints (2)
pyrox-lgmnoneSolvers and adjoints (2)
pyrox-ssmnoneSolvers and adjoints (2)
plumaxnoneCurvature (1)

Only vardax reads a card at these pins, the solvers-and-adjoints card, so the curvature and diagnostics cards are written before anything reads them. That order is right for a new library: a consumer’s switch-over then brings the card into its block in the same change that brings the import.

5Listed skill

One skill is listed, minimise-with-uncertainty, at most 150 lines, over all three units. It is asked for as “fit this by Gauss–Newton”, “what is the posterior covariance at the minimum” and “how many degrees of freedom does this retrieval have”. A library this size does not split by band: everyone who uses it works at ② to ④.

6What argminax needs from below

This is where argminax differs most: its floor is larger than its shelf.

FromSurfaces to a callerCard in
optimistixyes, everywhere: a cost is written in its fn(y, args) form, argminax’s solvers and adjoints subclass its abstract ones, and a solve that does not converge is reported through its RESULTSthe substrate card below
gaussxyes: every curvature is a gaussx operator, and one Newton step is gaussx.newton_updategaussx’s structures and primitives card and its strategies card (Table 6)
lineaxyes: the PSD tag on every curvature operatorcovered by gaussx’s card
matfreeno: behind the [matfree] extra, imported when callednone

The optimistix card is the first substrate card drafted for the tree, from argminax’s AGENTS.md @ c7bd0c3:

- **Provides.** Minimisation, least squares and root finding in JAX, with protocols for solvers and for adjoints.
- **Nouns.** A cost or residual function in the form `fn(y, args)`.
- **Verbs.** `optx.minimise`, `optx.least_squares`, `optx.root_find`.
- **Adverbs.** A solver and an adjoint. `optx.ImplicitAdjoint` differentiates through a converged minimum.
- **Keep.** A solve that does not converge is reported through `optx.RESULTS`; read it before using the value.
- **Never.** Read optimistix's private solve layout from outside argminax, which pins one minor version because its `KStep` does.
- **One rung down.** Open optimistix's own documentation to write a new solver; argminax's `add-solver` says how to subclass one.

7Where argminax bends the pattern

  1. The floor can be larger than the shelf. Most of what an argminax caller must know is optimistix’s and gaussx’s. The listed skill is short, and its cards do the work.

  2. Substrate cards have an owner by first use. No library of ours owns optimistix, so geostack keeps the card; the library that leans on it hardest drafts it, here argminax.

  3. Cards before readers. At the pins only vardax uses enough of a unit to receive its card. The shelf is still written, so each switch-over is one change.

  4. A boundary is a line on two cards. “One step is gaussx’s; the loop is argminax’s” belongs on gaussx’s inference card and on argminax’s solver card, in the same words.

  5. A small library keeps one listed skill. Three units, one front door, and no second band.

8Gates

Gates GX-0 to GX-6 of gaussx’s shelf apply with argminax’s names, and one is added.

GatePasses when
AM-1 Substrateevery third-party name in a substrate card is importable at the version the library pins

9Risks

10Relationships