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.
| Unit | Rungs | Home band | Subpackages | Names |
|---|---|---|---|---|
| Solvers and adjoints | ② ④ | ML | argminax.solve 14, argminax.adjoint 4, argminax.exceptions 3, argminax 1 | 22 |
| Curvature | ⓪ ③ | numerics, ML | argminax.curvature 7 | 7 |
| Diagnostics | ④ | ML | argminax.diagnose 6 | 6 |
| Bayesian learning rule | ② ④ | ML | argminax.blr 12 | 12 |
| All | 47 |
Table 2:Which part of argminax each dependent package uses.
| Dependent package | Names used | Solvers and adjoints | Curvature | Diagnostics | Bayesian learning rule |
|---|---|---|---|---|---|
| vardax | 6 | 5 | 1 | 0 | 0 |
| pyrox-nn | 3 | 0 | 1 | 2 | 0 |
| pyrox-gp | 2 | 2 | 0 | 0 | 0 |
| pyrox-lgm | 2 | 2 | 0 | 0 | 0 |
| pyrox-ssm | 2 | 2 | 0 | 0 | 0 |
| plumax | 1 | 0 | 1 | 0 | 0 |
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/.
| Role | Skill | Covers | Module |
|---|---|---|---|
| ⓪ structure | Curvature operators | gauss_newton and low_rank, returned as gaussx operators with their PSD tag | curvature |
| ② strategy | Gauss–Newton with an inner CG | GaussNewtonCG, as a solver passed to optimistix | solve |
| ② strategy | Adjoints for a solve stopped early | KStep, OneStep, to_optimistix_adjoint | adjoint |
| ② strategy | Positivity and bounds | Reparametrised | solve |
| ② strategy | add-solver | extend | |
| ③ model | The Laplace approximation | Laplace, marginal_variance, push_forward, sample_by_perturbation | curvature |
| ④ algorithm | Finding the mode | laplace_mode, its covariance and site forms, and their results | solve |
| ④ algorithm | Dual-form solves | dual_solve, incremental_dual_solve | solve |
| ④ algorithm | Retrieval diagnostics | averaging_kernel, degrees_of_freedom, information_content | diagnose |
| ④ algorithm | Evidence and the prior precision | evidence, optimize_prior_precision | diagnose |
| ⓪ ④ | add-diagnostic | extend: 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 package | Cards | Also uses |
|---|---|---|
| vardax | Solvers and adjoints (subclasses KStep) | Curvature (1) |
| pyrox-nn | none | Curvature (1); Diagnostics (2) |
| pyrox-gp | none | Solvers and adjoints (2) |
| pyrox-lgm | none | Solvers and adjoints (2) |
| pyrox-ssm | none | Solvers and adjoints (2) |
| plumax | none | Curvature (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.
| From | Surfaces to a caller | Card in |
|---|---|---|
| optimistix | yes, 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 RESULTS | the substrate card below |
| gaussx | yes: every curvature is a gaussx operator, and one Newton step is gaussx.newton_update | gaussx’s structures and primitives card and its strategies card (Table 6) |
| lineax | yes: the PSD tag on every curvature operator | covered by gaussx’s card |
| matfree | no: behind the [matfree] extra, imported when called | none |
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¶
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.
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.
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.
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.
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.
| Gate | Passes when |
|---|---|
| AM-1 Substrate | every third-party name in a substrate card is importable at the version the library pins |
9Risks¶
The substrate card is drafted from argminax’s notes, not from optimistix. It has not been checked against the pinned optimistix version. Fallback: gate AM-1, before the card ships.
gaussx’s Laplace step moves here. argminax’s
AGENTS.mdsays gaussx’slaplace_modemoves to argminax. Fallback: gaussx’s inference unit loses names and its table regenerates; the boundary line on both cards stays.
10Relationships¶
Parent: jejjohnson/geostack#150
Related: jejjohnson/geostack#151 (the design), jejjohnson/geostack#155 (shelves for the other libraries)
Related: skill tree, gaussx’s shelf