gaussx layout: gaussx-sketch, gaussx-linalg and gaussx-infer
Design · gaussx, its consumers, functax and the dependency graph
3 Dec 2026 · decided by the owner on 2 and 3 Dec 2026; the work is tracked by the epic gaussx#922
Status: decided (GX-D1 to GX-D3 on 2 Dec 2026, GX-D4 to GX-D10 on 3 Dec 2026); nothing open; GX-O2 and GX-O3 deferred
Repositories: gaussx (split into three packages), functax (one argument), geostack (the dependency graph), and gaussx’s consumers
Surveyed:
origin/mainof every repository named here, fetched on 2 Dec 2026 with gaussx at v0.8.4, and again on 3 Dec 2026 with gaussx at v0.9.0. The tables of “The graph after the split” and the counts of names are those of 3 Dec; the file sizes, the release history and the timings are those of 2 Dec
1Decision¶
gaussx becomes a uv workspace of three packages, each importing only the ones above it in this table:
| Package | Import name | Holds |
|---|---|---|
gaussx-sketch | gaussx_sketch | random sketches, randomized factorisations |
gaussx-linalg | gaussx_linalg | operators, primitives, solvers, preconditioners |
gaussx-infer | gaussx_infer | Gaussian inference and its building blocks |
The rule that places a module. A module belongs to gaussx-infer if it computes with a probability law: a density, a likelihood, an expectation under one, an update of a belief, or draws defined by one. Everything else is mathematics: gaussx-sketch if it is randomized and reaches a matrix only through products with it, gaussx-linalg otherwise. A module that could sit in two places goes in the lowest one its imports allow, and a file that mixes the two is divided. The folders of today’s gaussx do not follow this rule everywhere, so the packages are not the folders (“What moves”).
gaussx-sketch holds everything randomized: the sketches (Gaussian, orthonormal, SRHT, sparse sign, row sampling), the range finder, and the randomized SVD, eigendecomposition, Nyström factors, pivoted Cholesky and CUR. It needs JAX, Equinox, lineax, einx and jaxtyping and nothing else.
gaussx-linalg holds structured linear algebra that knows nothing about probability: the lineax operators and their tags, the dispatching primitives (solve, logdet, cholesky, sqrt, trace, eig, svd), the solver and log-determinant strategies, the preconditioners, the sparse Cholesky, and the builders of structured matrices (finite elements on meshes, graph and difference matrices, SPDE operators, Gauss-Newton operators).
gaussx-infer holds inference under a Gaussian assumption and the pieces it is built from: Gaussian densities and GMRFs, the exponential family, quadrature and likelihoods, GP and state-space recipes, and the ensemble, Laplace and site updates. It holds no Distribution: those are thin wrappers in pyrox-gauss, as today.
functax does not import gaussx. Its EOF basis takes the truncated SVD as an argument, so a caller that has both libraries passes gaussx_sketch.randomized_svd (GX-D3). An import of gaussx-sketch by functax is deferred until functax has a second use for it (GX-O2).
The name gaussx stays as a fourth, thin package that re-exports the three, so that import gaussx keeps working (GX-D9).
The audit also found code that is another library’s subject. All four cases are decided (GX-D6 to GX-D8 and GX-D10): the quantile root finder is gauss-flows-maps’s, great-circle distance is geophysix’s, the localisation tapers are kernellib’s, and functax assembles the finite-element matrices.
One thing is deliberately not done: gaussx-linalg is not cut further, because it is one import cycle (GX-D4).
What does not change: every public name and signature of gaussx 0.8.4, every number it computes, and the tiers of geostack’s graph.
2Motivation¶
gaussx is two libraries of equal size under one name, with a small third inside the first. On origin/main it is 213 source files (2.6 MB), 229 test files and 389 public names at v0.8.4 (390 names at v0.9.0, which the table counts). Placed by the rule, module by module:
| Package | Source | Modules | Public names |
|---|---|---|---|
gaussx-sketch | 75 KB | 11 | 16 |
gaussx-linalg | 1.2 MB | 96 | 173 |
gaussx-infer | 1.2 MB | 90 | 201 |
The sizes and module counts leave out the __init__.py files and are taken before the eight single names that change package are moved.
The folders are not the cut. A first draft of this page cut along the folder names, with the seven folders named for Gaussians (_distributions, _expfam, _gmrf, _gp, _quadrature, _ssm, _inference) on one side. Reading the 213 modules for what they compute moves these:
| Module or name | Folder today | Computes | Package |
|---|---|---|---|
all of _gmrf (12 names, 87 KB) | Gaussian | mass, stiffness, difference and graph matrices; SPDE operators; a pseudo-inverse by grounding; a constrained factorisation | gaussx-linalg |
project | _distributions | K_Xℐ K_ℐℐ⁻¹ through a Cholesky factor | gaussx-linalg |
quadratic_form, add_jitter | _distributions | xᵀ A⁻¹ x; A + ε I | gaussx-linalg |
gauss_newton_operator, gauss_newton_precision | _inference | Λ + Jᵀ Λ_ε J as an operator | gaussx-linalg |
ggn_diagonal, hutchinson_hessian_diag | _inference | diag(Jᵀ J); a stochastic Hessian diagonal | gaussx-linalg |
UDLDecomposition, udl_decomposition | _ssm | Λ = U D Uᵀ of a block-tridiagonal matrix | gaussx-linalg |
mixture_quantile_gaussian_approx | _primitives | quantiles of the Gaussian matched to an ensemble’s moments | gaussx-infer |
mixture_quantile, Chandrupatla | _primitives | the inverse of a CDF by bracketed root finding | leave gaussx (GX-D6) |
Every module moved down imports only linear algebra today, so no edge has to be cut for it. _gmrf is the large one: its docstring calls it “precision builders”, every import in it goes to the operators, the primitives, the sparse Cholesky and diag_inv, and kernellib uses three of its names to build mesh and graph matrices with no density in sight.
Four cases were judged and stay in gaussx-infer. The quadrature point sets take a mean and a covariance and return the points of that Gaussian. The filtering DARE returns the steady-state covariance and gain of a Kalman filter. The exact discretisation of a linear SDE returns a process-noise covariance. The Joseph form updates a posterior covariance. Each is a matrix computation, and each is stated in terms of a belief; none has a caller outside the state-space and quadrature code.
One case stays in gaussx-linalg although it draws. _primitives/_gaussian_draws.py applies a factor to standard normal noise, and four preconditioners call it for the probes of their log-determinant, so the linear algebra needs it.
After the moves the cut is clean. No module of gaussx-sketch or gaussx-linalg imports a module of gaussx-infer, at module scope or inside a function, and no module of gaussx-infer imports the sketch code directly. Under gaussx-sketch, three edges are left to cut (“Background: dependencies”).
Nine of the twenty-one packages that import gaussx need no gaussx-infer. They are gridax, spectraldiffx, sesmax-core, sesmax-ocean, kernellib, manipy, pyrox-nn, somax and optax_bayes; the table of “The graph after the split” has every package. With the folder cut it was seven: kernellib was held on the Gaussian side by three matrix builders, and pyrox-nn by ggn_diagonal.
integrix declared gaussx and imported nothing from it until 2 Dec 2026; since its Bayesian quadrature and ODE filter merged that day it imports ten names, all of gaussx-infer. sesmax-param is new the same day and imports GaussianPrior. somax is archived and optax_bayes is being retired.
A release of one part is a release of the others. gaussx tagged twelve releases between 6 and 28 November 2026 (v0.6.11 to v0.8.4). Four of them (v0.6.12 to v0.6.15) changed only files of gaussx-infer, one (v0.6.16) only files of gaussx-linalg, and seven changed both. The consumers’ pins run from v0.6.5 (manipy, somax) to v0.8.4 (pyrox, filterax, gauss_flows). A solver consumer such as gridax or sesmax reads every Kalman and GP changelog entry to decide whether to move its pin.
functax cannot import the randomized code, and does not need to. Its EOF basis takes a full SVD and keeps the leading rows. Three things stop it from importing gaussx’s randomized one:
The tier rule. functax and gaussx are both Core tier 0, and two repositories of one tier never import each other (the dependency graph).
functax’s own rule. Its
AGENTS.mdlets it import NumPy, JAX, Equinox, lineax, einx and jaxtyping, and no stack library. Thirteen repositories of the stack import functax on that footing.NumPy.
eof_basisruns the same on NumPy and on JAX;randomized_svdtakes a lineax operator and a JAX key.
An argument removes the need: eof_basis(..., svd=...) takes the routine from the caller. A routine written in JAX traces whether functax imported it or the caller passed it, so a chain that contains it still compiles under one jax.jit; the import would add a default, not a capability.
Install weight is a reason for the sketch package only. gaussx-sketch needs JAX, Equinox, lineax, einx and jaxtyping, which is exactly functax’s jax extra, so a later import by functax would add no third-party package. gaussx-linalg and gaussx-infer need the same ones as each other (matfree is imported by _primitives, _strategies, _linalg and _gp; optimistix by _primitives and _ssm), so the cut between them saves import work, not installs: import gaussx loads 210 gaussx modules, 100 of them in the seven folders named for Gaussians, and takes 0.69 s after JAX, lineax, Equinox and einx are loaded (one run on the shared VM).
The other libraries that do not import gaussx today (geonnax, xtremax, tracerax, geophysix, radiomax, diagnostix) all sit in layers above Core and may import it already; nothing in the graph stops them.
3User stories¶
As a user of functax’s EOF basis, I want the leading M patterns of a T × N data matrix without a full SVD, by passing the randomized routine I already have, so that the cost follows M and not min(T, N), the call still jits inside a larger chain, and functax imports nothing new.
As the author of a solver library (gridax, sesmax, spectraldiffx), I want CG, multigrid and structured operators from a package whose changelog is only linear algebra, so that I move my pin when a solver changes and not when a Kalman filter does.
As a contributor to gaussx’s linear algebra, I want to run the tests of the operators and solvers without the GP, state-space and ensemble tests, so that a change to a preconditioner is checked by the files that can see it.
As a user of pyrox or filterax, I want the split to cost me at most a dependency line, and nothing if
import gaussxis kept.
4Background: the rungs¶
On the role ladder the cuts fall under the operators and between the strategies and the models.
| Rung | gaussx-sketch | gaussx-linalg | gaussx-infer |
|---|---|---|---|
| ⓪ structures | sketches, factor records (CUR, ColumnID) | operators, tags | none of its own |
| ① primitives | range_finder, qb, randomized_svd, randomized_eigh, rp_cholesky, column_id, cur | solve, logdet, cholesky, sqrt, trace, eig, svd; builders of structured matrices | densities, KL, entropy, conditioning, sampling, quadrature points |
| ② strategies | none | solvers, log-determinant strategies, preconditioners | integrators |
| ③ models | none | none | GMRFs, likelihoods, SDE kernels |
| ④ algorithms | none | none | Kalman filters and smoothers, ensemble updates, Laplace, sites, natural-gradient updates |
Neither lower package has a model or an algorithm, which is what makes them safe to sit under every solver and every basis in the stack.
5Background maths¶
Why the randomized methods are a package of their own. They reach a matrix only through products with it. The range finder of Halko, Martinsson and Tropp draws a test matrix and orthonormalises
with rank k, oversampling p and q power iterations. The truncated SVD is the SVD of the small matrix ,
It costs 2(q + 1) passes over with k + p vectors each, against the O(T N min(T, N)) of the economy SVD that eof_basis takes today. No solve, log-determinant or strategy is needed, so nothing in it has to call back into the dispatch below.
The EOF basis is this problem. With the centred and weighted data , the EOFs are and only the leading M rows of are kept, so a truncated SVD of rank M gives the same patterns when the spectrum decays.
Why the linear-algebra package is one piece. A primitive dispatches on the structure of its operator and, where no structure helps, hands the work to a strategy; a strategy is written in terms of the primitives. For the solve,
and a strategy such as BBMM computes and together by calling the primitives on a preconditioned operator. The operators call the primitives too: a KroneckerSum solves through eig of its factors.
6Background: dependencies¶
The edges of the sketch part. _sketching (7 files, 37 KB) imports JAX, Equinox, lineax, einx and gaussx._einx, and nothing else. _randomized (7 files, 50 KB) adds three edges into the linear-algebra part:
| Module | Imports | From |
|---|---|---|
_svd.py, _nystrom.py | symmetrize | _linalg/_symmetrize.py, itself a leaf with no gaussx imports |
_nystrom.py | LowRankUpdate, svd_low_rank_plus_diag | _operators (the return type of randomized_nystrom) |
_trace.py | resolve_sampler | _primitives/_samplers.py, which imports matfree |
The linear-algebra part imports the sketch part in eight modules (_primitives for eig, svd, root and trace; _strategies for the Nyström log-determinant and the sketch preconditioner; _preconditioners for Nyström and partial Cholesky), which is the direction the packages keep.
The import cycle inside the linear-algebra part. On origin/main, at module scope or inside functions:
| Edge | Example |
|---|---|
_primitives → _strategies | _inv_quad_logdet.py imports AutoSolver, BBMMSolver, DenseSolver |
_strategies → _primitives | _dense.py, _dispatch.py import solve, logdet |
_operators → _primitives | _sum_kronecker.py imports eig, cholesky, sqrt |
_primitives → _operators | 81 imports |
_linalg → _strategies | _diag_inv.py, _linalg.py import dispatch_solve |
_strategies → _preconditioners → _primitives | _cg.py; _nystrom.py imports matrix_free_diag |
_primitives → _sparse → _primitives | _cholesky.py imports sparse_cholesky |
gaussx’s own architecture page calls this the dispatch core, and tests/test_lazy_imports.py lists each in-function import that closes it.
Inside gaussx-infer. After the moves the edges point one way, from the recipes to the calculus:
| Subject | Modules today | Imports, inside gaussx-infer |
|---|---|---|
| Gaussian calculus | _distributions, _expfam | none |
| Quadrature and likelihoods | _quadrature | calculus |
| GP recipes | _gp | calculus |
| State space | _ssm | calculus, quadrature |
| Ensemble updates | _inference (seven files) | none |
| Approximate inference | _inference (six files) | calculus, quadrature, GP recipes |
7The graph after the split¶
Inside Core. The graph lets an edge inside one repository stay level, so the three packages share gaussx’s tier, and no tier of the graph changes.
| Package | Layer, tier | Imports (ours) |
|---|---|---|
| pipekit | Core, 0 | none |
gaussx-sketch | Core, 0 (in gaussx) | none |
gaussx-linalg | Core, 0 (in gaussx) | gaussx-sketch |
gaussx-infer | Core, 0 (in gaussx) | gaussx-linalg |
| functax | Core, 0 | none |
| argminax | Core, 1 | gaussx-infer |
| integrix | Core, 1 | functax, gaussx-infer |
gauss-flows-maps | Core, 1 | functax |
Every package that imports gaussx. Twenty-one packages in fifteen repositories import gaussx in their source on 3 Dec 2026. Each edge of the figure is the highest gaussx package a consumer imports from; a consumer of gaussx-infer reaches the other two through it.
What each one imports. The counts are the public names its source imports from each of the three packages, placed by the rule (tests and docs left out). The graph asks that every import be declared, so a package declares each gaussx package it imports from by name, not only the highest.
| Package | Layer, tier | Sketch | Linear algebra | Gaussian | Declares after the split |
|---|---|---|---|---|---|
| argminax | Core, 1 | 1 | 16 | 8 | all three |
| integrix | Core, 1 | 0 | 0 | 10 | gaussx-infer |
| spectraldiffx | GeoNumerics, 0 | 0 | 7 | 0 | gaussx-linalg |
| gridax | GeoNumerics, 1 | 0 | 9 | 0 | gaussx-linalg |
gauss-flows-models | GeoML, 0 | 0 | 5 | 14 | gaussx-linalg, gaussx-infer |
| kernellib | GeoML, 1 | 3 | 24 | 0 | gaussx-sketch, gaussx-linalg |
pyrox-gauss | GeoML, 1 | 0 | 14 | 12 | gaussx-linalg, gaussx-infer |
| filterax | GeoML, 2 | 0 | 8 | 29 | gaussx-linalg, gaussx-infer |
| manipy | GeoML, 2 | 0 | 3 | 0 | gaussx-linalg |
pyrox-gp | GeoML, 3 | 0 | 25 | 33 | gaussx-linalg, gaussx-infer |
pyrox-lgm | GeoML, 3 | 0 | 18 | 20 | gaussx-linalg, gaussx-infer |
pyrox-nn | GeoML, 3 | 0 | 7 | 0 | gaussx-linalg |
pyrox-ssm | GeoML, 3 | 0 | 5 | 33 | gaussx-linalg, gaussx-infer |
| vardax | GeoML, 3 | 0 | 16 | 4 | gaussx-linalg, gaussx-infer |
| radtrax | GeoModels, 0 | 1 | 7 | 2 | all three |
sesmax-core | GeoModels, 0 | 0 | 4 | 0 | gaussx-linalg |
sesmax-ocean | GeoModels, 0 | 0 | 3 | 0 | gaussx-linalg |
sesmax-param | GeoModels, 0 | 0 | 0 | 1 | gaussx-infer |
| plumax | GeoModels, 1 | 0 | 4 | 3 | gaussx-linalg, gaussx-infer |
| somax (archived) | not in the graph | 0 | 1 | 0 | none: no issue is filed |
| optax_bayes (being retired) | not in the graph | 0 | 4 | 0 | none: no issue is filed |
The sketch names imported directly are randomized_eigh (argminax), randomized_eigh, rp_cholesky and hadamard_transform (kernellib) and randomized_svd (radtrax).
The consumers with few names in gaussx-infer use it for what it is: radtrax for gaussian_log_prob and sample_mvn, plumax for ensemble_covariance, gauss_hermite_points and information_diagnostics, vardax for ensemble_covariance, information_diagnostics, linear_gaussian_update and sample_mvn.
Declared and not imported. Three pyproject.toml files list gaussx while no source file under them imports it: the workspace roots of pyrox, sesmax and gridax. Each drops the line or, for a workspace root that only pins its members’ version, renames it.
The rest of the stack. pipekit, functax, geotoolz, geophysix, radiomax, tracerax, diagnostix, geonnax and xtremax have no import of gaussx; the split changes nothing for them, and they gain three smaller packages they could import.
8What moves¶
From src/gaussx/ | To |
|---|---|
_sketching, _randomized (without _trace.py) | gaussx_sketch |
_operators, _primitives (without _quantile.py and _chandrupatla.py), _strategies, _preconditioners, _linalg, _sparse, _solve_frontend.py, _tags.py, _known_values.py, _deprecation.py | gaussx_linalg |
_gmrf, as _builders | gaussx_linalg |
_distributions/_project.py; quadratic_form and add_jitter of _distributions/_gaussian.py | gaussx_linalg, in _linalg |
the four curvature names of _inference/_natural_gradient.py and _inference/_blr.py | gaussx_linalg, in _operators and _primitives |
UDLDecomposition and udl_decomposition of _ssm/_udl.py | gaussx_linalg, in _linalg |
_distributions, _expfam, as _gaussians | gaussx_infer |
_quadrature, _gp | gaussx_infer |
_ssm, with _gp/_interpolation.py (it smooths a state-space model) and the two udl_*_ssm_params conversions | gaussx_infer |
the seven ensemble files of _inference, as _ensemble | gaussx_infer |
the rest of _inference, as _approximate | gaussx_infer |
mixture_quantile_gaussian_approx of _primitives/_quantile.py | gaussx_infer, in _gaussians; the rest of the file and _primitives/_chandrupatla.py leave gaussx (GX-D6) |
_testing.py | divided: the operator and tolerance helpers to gaussx_linalg, empirical_moments and assert_sample_moments to gaussx_infer |
__init__.py | divided in three |
Tests follow the module they test, and the 22 repository-wide test files stay at the workspace root. No public name changes in the split itself. The names that leave gaussx for another library (GX-D6 to GX-D8) do so in issues of their own, beside the split.
The folders are renamed where the old name misleads. _gmrf holds no random field, so it becomes _builders. _inference inside a package named gaussx_infer says nothing and holds two unrelated families: its ensemble files (_enkf.py, _etkf.py, _eki.py, _ensemble_smoother.py, _ensemble_stats.py, _inflation.py, _localization.py) become _ensemble, and the rest (_laplace.py, _sites.py, _natural_gradient.py, _blr.py, _vb_correction.py, _inference.py) become _approximate. _distributions holds no Distribution and joins _expfam as _gaussians.
Four changes cut the sketch part free, and can merge before anything moves:
Nyström.
randomized_nystromis divided intonystrom_factors, which returns (U, γ̂) and goes to the sketch package, and the wrapper that builds theLowRankUpdate, which stays with the operator ingaussx-linalgunder the namerandomized_nystrom. Its result is unchanged.Hutch++.
hutchpp_tracemoves from_randomized/_trace.pyto_primitives, next to the trace primitive that is its only caller, taking the matfree sampler with it. It is a trace estimator, not a factorisation, and it is what would bring matfree into the sketch package.symmetrize. The two sketch modules that call it take a private one-line helper of their own; the publicsymmetrizestays ingaussx-linalg.Pivoted Cholesky.
_preconditioners/_partial_cholesky.pyimports the private_pivoted_choleskyof_randomized/_rpcholesky.py. It gets a public name in the sketch package, so that no package imports a private module of another.
The einx wrappers (_einx.py, four functions, 4 KB) are used by all three packages. Each package carries its own copy, and a test at the workspace root asserts that the three files are identical, so no package imports a private module of another.
9Background numerics¶
Nothing computes differently. The split moves modules; no operator, solve, density or filter changes (gate GX-G2).
One jit boundary. No package jits internally; the caller jits once at the top, as in the rest of the stack.
The randomized SVD traces. Its shapes are fixed by the rank and the oversampling, so a chain that centres the data, takes a randomized SVD, projects on the EOFs and returns the unexplained variance compiles under one jax.jit and has a finite gradient with respect to the data. On the toy matrix below it returns an unexplained variance of 8.513 × 10⁻³ for five modes, the value of the exact SVD to the four digits printed (gaussx 0.8.4).
It needs power iterations on slowly decaying spectra. On a toy data matrix (T = 200, N = 2,000, twenty modes with singular values 10 · 0.6ᵃ plus noise of standard deviation 10⁻³, float64, gaussx 0.8.4, functax 0.0.15, JAX 0.12.1), the leading five EOFs from gaussx.randomized_svd against those of eof_basis:
n_power_iter | Largest relative error of the singular values | Sine of the largest principal angle |
|---|---|---|
| 0 | 1.1 × 10⁻² | 2.4 × 10⁻² |
| 2 (the default) | 8.8 × 10⁻¹⁴ | 3.3 × 10⁻⁸ |
So the exact SVD stays the default of eof_basis, and a truncated one is the caller’s choice, with its rank, oversampling, power iterations and key in the caller’s hands.
NumPy. eof_basis runs on NumPy alone today and returns arrays of its input’s namespace. The argument keeps that: a NumPy caller passes a NumPy routine, a JAX caller passes gaussx’s, and functax treats both the same.
10API proposal¶
The workspace¶
# gaussx/pyproject.toml (the workspace root; no package of its own)
[tool.uv.workspace]
members = ["packages/*"]
# packages/gaussx-sketch/pyproject.toml
[project]
name = "gaussx-sketch"
dependencies = ["jax", "jaxlib", "equinox", "lineax", "jaxtyping", "einx"]
# packages/gaussx-linalg/pyproject.toml
[project]
name = "gaussx-linalg"
dependencies = ["gaussx-sketch", "jax", "jaxlib", "equinox", "lineax", "matfree",
"jaxtyping", "einx", "optimistix", "scipy"]
# packages/gaussx-infer/pyproject.toml
[project]
name = "gaussx-infer"
dependencies = ["gaussx-linalg", "jax", "jaxlib", "equinox", "lineax", "matfree",
"jaxtyping", "einx", "optimistix"]Version floors are those of gaussx 0.8.4.
scipy is new on the list: _sparse imports scipy.sparse today, and gaussx gets it only because JAX depends on it.
Each package gets its own release-please component and tag (gaussx-sketch-vX.Y.Z and so on), as the members of pyrox, pipekit and gauss_flows do, and each pins the release of the package below it that it was tested with.
gaussx_sketch¶
# proposed (GX-D1; today gaussx): 16 of today's names, and one new
from gaussx_sketch import (
AbstractSketch, GaussianSketch, OrthonormalSketch, # ⓪ sketches
SRHTSketch, SparseSignSketch, RowSamplingSketch,
hadamard_transform,
range_finder, qb, # ① the range finder
randomized_svd, randomized_eigh, rp_cholesky, # ① factorisations
column_id, cur, ColumnID, CUR,
nystrom_factors, # new: (U, γ̂) of randomized_nystrom
)gaussx_linalg¶
# proposed (GX-D1; today gaussx): the same names
from gaussx_linalg import (
Kronecker, BlockDiag, LowRankUpdate, MaskedOperator, # ⓪ operators
solve, logdet, cholesky, sqrt, trace, eig, svd, # ① primitives
CGSolver, DenseSolver, AutoSolver, BBMMSolver, # ② strategies
NystromPreconditioner, MultigridPreconditioner, # ② preconditioners
linear_solve_with_info, as_linear_operator, # the front door
randomized_nystrom, # the LowRankUpdate wrapper
)Its 173 public names, among them the builders (fem_matrices, spde_precision, rw1_structure, besag_structure) and the Gauss-Newton operators.
gaussx_infer¶
# proposed (GX-D1; today gaussx): the same names
from gaussx_infer import (
gaussian_log_prob, gaussian_kl, sample_mvn, GaussianMRF, # densities and GMRFs
GaussHermiteIntegrator, GaussianLikelihood, # quadrature and likelihoods
kalman_filter, rts_smoother, SDEKernel, # state space
enkf_analysis, laplace_model, site_posterior, # inference
)Its 200 public names.
gaussx, the re-export (GX-D9)¶
# proposed (GX-D9): packages/gaussx/src/gaussx/__init__.py, the whole of the package
from gaussx_sketch import *
from gaussx_linalg import *
from gaussx_infer import *set(gaussx.__all__) is then the set of 0.8.4.
functax¶
# proposed (GX-D3; today functax.basis.eigen.eof_basis has no `svd`)
# X W^½ ≈ U S Vᵀ of rank M, by the caller's routine
# (T, N), M → Φ (N, M), σ (M,)
def eof_basis(
data: Float[Array, "T N"],
n_modes: int,
*,
center: bool = True,
weights: Float[Array, " N"] | None = None,
svd: Callable[[Float[Array, "T N"], int], tuple[Any, Float[Array, " M"], Float[Array, "M N"]]] | None = None,
) -> tuple[Float[Array, "N M"], Float[Array, " M"]]: ...svd=None is today’s economy SVD. A given svd is called as svd(matrix, n_modes) on the centred and weighted matrix and returns (U, S, Vᵀ) with M rows in Vᵀ. functax imports nothing new, and its dependencies, extras and AGENTS.md rule are unchanged.
What the consumers change¶
| Consumer | With gaussx kept (GX-O1 A) | Without it (GX-O1 B) |
|---|---|---|
the six repositories that need no gaussx-infer (gridax, spectraldiffx, kernellib, manipy, and the retired somax and optax_bayes) | nothing at the split; gaussx-linalg when each next moves its pin | gaussx-linalg and its import name, at the split |
| the nine others | nothing | gaussx-infer and up to three import names, at the split |
| pyrox | two private imports (gaussx._deprecation.GaussxDeprecationWarning, gaussx._linalg._diag_inv._diag_inv_structured) get public homes first | the same |
| functax | the svd argument; no dependency on gaussx | the same |
| geostack | three or four packages for gaussx in the graph, guards regenerated | the same |
11API usage examples¶
EOFs by a randomized SVD, in one jitted chain. The first two calls ran on 2 Dec 2026 and gave the numbers of “Background numerics”; the third is the proposal.
# Shapes: T = 200 samples; N = 2,000 grid points; M = 5 modes
# today (functax)
# X − x̄ = U S Vᵀ, the economy SVD; Φ = V[:, :M]
# (T, N) → (N, M), (M,)
Phi, sigma = eof_basis(X, 5)
# today (gaussx)
# Y = (A Aᵀ)² A Ω, Q R = Y, Qᵀ A = Ũ S Vᵀ
# (T, N) → (T, M), (M,), (M, N)
A = lx.MatrixLinearOperator(X - X.mean(0, keepdims=True))
U, s, Vt = gaussx.randomized_svd(A, rank=5, n_power_iter=2, key=key)
# proposed (GX-D3)
# the same patterns through eof_basis, then the share of variance left out, as one compiled function
# (T, N) → ()
@jax.jit
def unexplained(X, key):
def truncated(matrix, n_modes):
return gaussx_sketch.randomized_svd(lx.MatrixLinearOperator(matrix), rank=n_modes, key=key)
Phi, sigma = eof_basis(X, 5, svd=truncated)
anomaly = X - X.mean(0, keepdims=True)
return jnp.sum((anomaly - anomaly @ Phi @ Phi.T) ** 2) / jnp.sum(anomaly ** 2)A solver consumer, on the linear-algebra package.
# Shapes: N = 4,096 grid cells
# today (gridax, through gaussx)
# A = −∇² on the wet cells, as a lineax operator
# (N,) → (N,)
A = as_linear_operator(apply_laplacian, in_structure)
# proposed (GX-D1; today gaussx.linear_solve_with_info)
# x = A⁻¹ b by conjugate gradients
# (N,), (N,) → (N,), info
from gaussx_linalg import CGSolver, linear_solve_with_info
x, info = linear_solve_with_info(A, b, solver=CGSolver())apply_laplacian, in_structure and b are the caller’s; the arguments of as_linear_operator are sketched.
A Gaussian consumer.
# Shapes: T = 100 steps; D = 2 state dims
# proposed (GX-D1; today gaussx.kalman_filter, which GX-O1 A keeps working)
# p(x_{1:T} | y_{1:T}) of a linear Gaussian state-space model
from gaussx_infer import kalman_filter
filtered = kalman_filter(...)12Gates¶
| Gate | Passes when |
|---|---|
| GX-G1 cut | no package imports one below it in the table of “Decision” |
| GX-G2 names | the public names of 0.8.4 are all still importable, as the same objects |
| GX-G3 sketch | gaussx-sketch installs with JAX, Equinox, lineax, einx and jaxtyping alone |
| GX-G4 light | importing a package loads no module of a package below it in the table |
| GX-G5 consumers | the thirteen live consumers’ tests pass |
| GX-G6 graph | geostack’s dependency check passes, with no tier changed |
| GX-G7 functax | EOFs through a passed routine match the exact ones, and jit |
GX-G1 cut. A test in each package fails if gaussx_sketch imports gaussx_linalg or gaussx_infer, or gaussx_linalg imports gaussx_infer; the sketch package’s tests and doctests run with neither of the others installed, and the linear-algebra package’s without gaussx-infer.
GX-G2 names. A snapshot of gaussx.__all__ at v0.8.4 is the union of the three packages’ __all__ less nystrom_factors, with no name in two packages.
GX-G3 sketch. uv pip install gaussx-sketch in a clean environment installs none of matfree, optimistix or SciPy beyond what JAX brings, and import gaussx_sketch succeeds there.
GX-G4 light. After import gaussx_sketch in a fresh interpreter no module of gaussx_linalg or gaussx_infer is in sys.modules, and after import gaussx_linalg none of gaussx_infer (today import gaussx loads 210 gaussx modules).
GX-G5 consumers. Each consumer’s test suite passes against the first split release: with its source untouched if gaussx is kept, with only its dependency line and import names changed if not.
GX-G6 graph. tests/test_dependency_graph.py in geostack passes with the three packages at Core tier 0 and every other tier as today, and the regenerated guards of gaussx and its consumers list the edges they use.
GX-G7 functax. On the toy matrix of “Background numerics”, eof_basis(..., svd=...) with gaussx_sketch.randomized_svd at its default two power iterations matches svd=None to 10⁻¹⁰ in the singular values and runs under jax.jit, in a test that imports gaussx only in the test; with a NumPy routine passed in, the outputs are NumPy arrays.
13Open questions¶
GX-O1: is the name gaussx kept¶
Decided on 3 Dec 2026: option A (GX-D9). The two options are kept here for the record.
(A) A fourth, thin package
gaussxthat depends on the three and re-exports them. Recommended.import gaussxmeans what it means today, the consumers change nothing when the split lands, and each moves to the smaller package it needs when it next moves its pin. It costs a fourth release component and a namespace that does not say which package a name is in.(B) No
gaussxpackage. Three names and nothing else; every consumer changes its dependency line and its imports with the split release, in thirteen PRs. It is the stack’s usual choice of no compatibility layer, and the right one if the name should stop meaning “all of it”.
GX-O2: functax imports gaussx-sketch¶
Deferred. The import would let functax offer a randomized SVD by name, without the caller writing a wrapper. Its costs are known: functax’s first stack dependency, behind an extra; functax at Core tier 1, with integrix and gauss-flows-maps at tier 2; and a randomized path that exists on JAX and not on NumPy. Two facts make it cheap to take up later: gaussx-sketch needs nothing beyond functax’s jax extra, and the sketch code changed in none of gaussx’s last twelve releases (its last functional change was on 7 October 2026), so it would rarely move functax’s pin.
The trigger is a second place in functax that wants a truncated factorisation; its mesh and graph Laplacian bases and its Slepian bases take dense eigh today.
GX-O3: a finer cut of the Gaussian package¶
Deferred, with the facts for a later page. _ssm is the largest subpackage (442 KB, 55 names) and is used by pyrox, filterax and gauss_flows. _inference (272 KB) holds two unrelated families: the ensemble updates (_enkf.py, _etkf.py, _eki.py, _ensemble_smoother.py, _ensemble_stats.py, _inflation.py, _localization.py), of which filterax imports 21 names, and the Laplace, site, natural-gradient and variational updates, which argminax and pyrox import. _ensemble imports nothing else of gaussx-infer once _inference is divided (“What moves”), so it is the piece that could leave first, and filterax is its main user.
GX-O4: code that is another library’s subject¶
The audit found four things in gaussx that the stack already has a home for. The owner decided all four on 3 Dec 2026, and each has its issues under the epic.
Quantiles and their root finder (GX-D6).
mixture_quantileandChandrupatlahave the same signature and the same solver asmonotone_inverseandChandrupatlaofgauss_flows_maps.monotone. gaussx removes its two (gaussx#929);mixture_quantile_gaussian_approx, which uses no root finder, stays ingaussx-infer.Great-circle distance (GX-D7). geophysix owns it. kernellib’s
great_circle_distancebecomes a call to geophysix’s (kernellib#326), a new edge from GeoML to GeoNumerics that changes no tier, and gaussx removeshaversine_distance(gaussx#930).Tapers (GX-D8).
gaspari_cohn,gaussian_taper,soar_taperandlocalization_matrixmove to kernellib (kernellib#325); filterax takes them from there (filterax#223), a new edge from GeoML tier 2 to tier 1, and gaussx removes them (gaussx#930).localized_kalman_gainstays ingaussx-infer: it is a Kalman gain and already takes the taper matrices as arguments.Finite elements on a mesh (GX-D10).
fem_matricesbuilds the P1 lumped mass and stiffness matrices andfem_projectorthe P1 interpolation matrix; functax’scotangent_laplacian_eigpairsbuilds the same two matrices, densely and privately. functax takes the assembly and returns the entries as plain arrays (functax#208), because it cannot build gaussx’sSparseOperatorand the two libraries cannot import each other. kernellib, which imports both, wraps the entries in operators once (kernellib#327),pyrox-lgmtakes them from kernellib (pyrox#610), and gaussx removes its two functions (gaussx#931). The options that were weighed are in functax#207.
One duplicate to check on the other side: pyrox-gauss defines log_prob on its multivariate normal base class and does not import gaussx.gaussian_log_prob.
14Risks¶
The workspace conversion is a migration. CI, release-please, the docs site, the plugin skill and geostack’s submodule all change for gaussx. Mitigation: one PR does the move with no behaviour change, after the four sketch changes have merged on their own.
Three release trains. A change that touches linear algebra and Gaussians (seven of the last twelve releases) becomes two releases in order. Mitigation: each package pins the one below it exactly, so a consumer still moves one pin.
Private imports break. pyrox imports two private paths. Mitigation: they get public homes before the split.
15Follow-up issues¶
Filed on 3 Dec 2026 under the epic gaussx#922, each written to be read on its own.
| Step | Issue | Does | Gate |
|---|---|---|---|
| X1 | gaussx#923 | the four changes that cut the sketch part free, with a guard test | GX-G1 for the sketch modules |
| X2 | gaussx#924, pyrox#608 | public homes for the two private imports, and pyrox on them | GX-G5 |
| X3 | gaussx#925, gaussx#926 | the folders follow the rule: matrix code out of the Gaussian folders, then the renames | GX-G1 inside one package |
| X4 | gaussx#928 | the decision GX-O1, closed as GX-D9 | none |
| X5 | gaussx#927 | the workspace conversion, with no behaviour change | GX-G1 to GX-G4 |
| X6 | geostack#361 | the packages in the graph, guards regenerated, pins moved | GX-G6 |
| X7 | functax#206 | eof_basis(..., svd=...) | GX-G7 |
| X8 | integrix#131, argminax#116, filterax#222, gauss_flows#234, kernellib#324, manipy#55, pyrox#609, gridax#626, plumax#473, radtrax#342, sesmax#412, spectraldiffx#181, vardax#336 | each consumer declares and imports the packages it uses | GX-G5 |
| X9 | gaussx#929, kernellib#325, kernellib#326, filterax#223, gaussx#930, functax#208, kernellib#327, pyrox#610, gaussx#931 | the code that is another library’s subject (GX-D6 to GX-D8, GX-D10) | each issue’s own |
X1, X2, X3, X4 and X7 are independent of each other; X5 needs X1 to X4; X6 and X8 need X5’s release. X9 runs beside the split and does not block it.
16Decisions¶
| ID | Decision | Status |
|---|---|---|
| GX-D1 | gaussx becomes a uv workspace of three packages: sketch, linear algebra and Gaussian inference | decided 2 Dec 2026 |
| GX-D2 | the names gaussx-sketch, gaussx-linalg and gaussx-infer | decided 2 Dec 2026 |
| GX-D3 | functax does not import gaussx; eof_basis takes the truncated SVD as an argument | decided 2 Dec 2026 |
| GX-D4 | gaussx-linalg is not cut further: it is one import cycle | decided 3 Dec 2026 |
| GX-D5 | a module is placed by what it computes (a probability law, or not), not by its folder; the moves of “What moves” follow | decided 3 Dec 2026 |
| GX-D6 | the bracketed inverse of a CDF and its root finder are gauss-flows-maps’s; gaussx removes mixture_quantile and Chandrupatla | decided 3 Dec 2026 |
| GX-D7 | great-circle distance is geophysix’s; kernellib calls it and gaussx removes haversine_distance | decided 3 Dec 2026 |
| GX-D8 | the localisation tapers are kernellib’s; localized_kalman_gain stays in gaussx | decided 3 Dec 2026 |
| GX-D9 | the name gaussx is kept as a thin package that re-exports the three (option A of GX-O1) | decided 3 Dec 2026; gaussx#928 |
| GX-D10 | functax assembles the P1 finite-element matrices and returns their entries; kernellib wraps them in operators; gaussx removes fem_matrices and fem_projector (option A of GX-O4) | decided 3 Dec 2026; functax#207 |
| GX-O2 | functax imports gaussx-sketch behind an extra, with Core’s tiers moved | deferred until a second use in functax |
| GX-O3 | a finer cut of the Gaussian package | deferred |
GX-D1 to GX-D3 were decided by the owner on 2 Dec 2026, and GX-D4 to GX-D10 on 3 Dec 2026. The third package was first named gaussx-dist; it became gaussx-infer because the distributions already live in pyrox-gauss and what the package holds is inference under a Gaussian assumption. GX-D3 was first decided as an import behind an extra and changed the same day to the argument, because a routine passed in jits as well as one imported, and the import would have cost functax its rule and Core a tier for one call site.
17References¶
Halko, N., Martinsson, P.-G. & Tropp, J. A. (2011). Finding structure with randomness: probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review 53(2), 217–288 Halko et al., 2011. Algorithms 4.4 and 5.1 are the range finder and the SVD of
gaussx._randomized.Beckers, J.-M. & Rixen, M. (2003). EOF calculations and data filling from incomplete oceanographic datasets. Journal of Atmospheric and Oceanic Technology 20(12), 1839–1856 Beckers & Rixen, 2003. The reference of
eof_basis.The role ladder: Kinds and roles.
The rules of the graph: the dependency graph page.
The same kind of split, decided and built: gauss_flows layout.
gaussx’s layers and its dispatch core: gaussx architecture.
- Halko, N., Martinsson, P.-G., & Tropp, J. A. (2011). Finding structure with randomness: probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review, 53(2), 217–288. 10.1137/090771806
- Beckers, J.-M., & Rixen, M. (2003). EOF calculations and data filling from incomplete oceanographic datasets. Journal of Atmospheric and Oceanic Technology, 20(12), 1839–1856.