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.

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

1Decision

gaussx becomes a uv workspace of three packages, each importing only the ones above it in this table:

PackageImport nameHolds
gaussx-sketchgaussx_sketchrandom sketches, randomized factorisations
gaussx-linalggaussx_linalgoperators, primitives, solvers, preconditioners
gaussx-infergaussx_inferGaussian 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:

PackageSourceModulesPublic names
gaussx-sketch75 KB1116
gaussx-linalg1.2 MB96173
gaussx-infer1.2 MB90201

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 nameFolder todayComputesPackage
all of _gmrf (12 names, 87 KB)Gaussianmass, stiffness, difference and graph matrices; SPDE operators; a pseudo-inverse by grounding; a constrained factorisationgaussx-linalg
project_distributionsK_Xℐ K_ℐℐ⁻¹ through a Cholesky factorgaussx-linalg
quadratic_form, add_jitter_distributionsxᵀ A⁻¹ x; A + ε Igaussx-linalg
gauss_newton_operator, gauss_newton_precision_inferenceΛ + Jᵀ Λ_ε J as an operatorgaussx-linalg
ggn_diagonal, hutchinson_hessian_diag_inferencediag(Jᵀ J); a stochastic Hessian diagonalgaussx-linalg
UDLDecomposition, udl_decomposition_ssmΛ = U D Uᵀ of a block-tridiagonal matrixgaussx-linalg
mixture_quantile_gaussian_approx_primitivesquantiles of the Gaussian matched to an ensemble’s momentsgaussx-infer
mixture_quantile, Chandrupatla_primitivesthe inverse of a CDF by bracketed root findingleave 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:

  1. The tier rule. functax and gaussx are both Core tier 0, and two repositories of one tier never import each other (the dependency graph).

  2. functax’s own rule. Its AGENTS.md lets it import NumPy, JAX, Equinox, lineax, einx and jaxtyping, and no stack library. Thirteen repositories of the stack import functax on that footing.

  3. NumPy. eof_basis runs the same on NumPy and on JAX; randomized_svd takes 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 gaussx is kept.

4Background: the rungs

On the role ladder the cuts fall under the operators and between the strategies and the models.

Runggaussx-sketchgaussx-linalggaussx-infer
⓪ structuressketches, factor records (CUR, ColumnID)operators, tagsnone of its own
① primitivesrange_finder, qb, randomized_svd, randomized_eigh, rp_cholesky, column_id, cursolve, logdet, cholesky, sqrt, trace, eig, svd; builders of structured matricesdensities, KL, entropy, conditioning, sampling, quadrature points
② strategiesnonesolvers, log-determinant strategies, preconditionersintegrators
③ modelsnonenoneGMRFs, likelihoods, SDE kernels
④ algorithmsnonenoneKalman 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 A∈RM×N\mathbf{A} \in \mathbb{R}^{M \times N} only through products with it. The range finder of Halko, Martinsson and Tropp draws a test matrix Ω∈RN×(k+p)\boldsymbol{\Omega} \in \mathbb{R}^{N \times (k+p)} and orthonormalises

Y=(AA⊤)q A Ω,Y=QR,\mathbf{Y} = (\mathbf{A}\mathbf{A}^\top)^{q}\, \mathbf{A}\, \boldsymbol{\Omega}, \qquad \mathbf{Y} = \mathbf{Q}\mathbf{R},

with rank k, oversampling p and q power iterations. The truncated SVD is the SVD of the small matrix B=Q⊤A∈R(k+p)×N\mathbf{B} = \mathbf{Q}^\top \mathbf{A} \in \mathbb{R}^{(k+p) \times N},

B=U~ S V⊤,A≈(QU~) S V⊤.\mathbf{B} = \tilde{\mathbf{U}}\, \mathbf{S}\, \mathbf{V}^\top, \qquad \mathbf{A} \approx (\mathbf{Q}\tilde{\mathbf{U}})\, \mathbf{S}\, \mathbf{V}^\top .

It costs 2(q + 1) passes over A\mathbf{A} 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 XW1/2=USV⊤\mathbf{X}\mathbf{W}^{1/2} = \mathbf{U}\mathbf{S}\mathbf{V}^\top, the EOFs are Φ=W−1/2V\boldsymbol{\Phi} = \mathbf{W}^{-1/2}\mathbf{V} and only the leading M rows of V⊤\mathbf{V}^\top 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,

x=solve(A,b)={a closed form of the structure of A(Kronecker, block, low-rank update, …)strategy.solve(A,b)otherwise\mathbf{x} = \mathrm{solve}(\mathbf{A}, \mathbf{b}) = \begin{cases} \text{a closed form of the structure of } \mathbf{A} & \text{(Kronecker, block, low-rank update, …)} \\ \mathrm{strategy.solve}(\mathbf{A}, \mathbf{b}) & \text{otherwise} \end{cases}

and a strategy such as BBMM computes b⊤A−1b\mathbf{b}^\top \mathbf{A}^{-1} \mathbf{b} and log⁡det⁡A\log\det\mathbf{A} 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:

ModuleImportsFrom
_svd.py, _nystrom.pysymmetrize_linalg/_symmetrize.py, itself a leaf with no gaussx imports
_nystrom.pyLowRankUpdate, svd_low_rank_plus_diag_operators (the return type of randomized_nystrom)
_trace.pyresolve_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:

EdgeExample
_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 → _operators81 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:

SubjectModules todayImports, inside gaussx-infer
Gaussian calculus_distributions, _expfamnone
Quadrature and likelihoods_quadraturecalculus
GP recipes_gpcalculus
State space_ssmcalculus, 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.

PackageLayer, tierImports (ours)
pipekitCore, 0none
gaussx-sketchCore, 0 (in gaussx)none
gaussx-linalgCore, 0 (in gaussx)gaussx-sketch
gaussx-inferCore, 0 (in gaussx)gaussx-linalg
functaxCore, 0none
argminaxCore, 1gaussx-infer
integrixCore, 1functax, gaussx-infer
gauss-flows-mapsCore, 1functax

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.

PackageLayer, tierSketchLinear algebraGaussianDeclares after the split
argminaxCore, 11168all three
integrixCore, 10010gaussx-infer
spectraldiffxGeoNumerics, 0070gaussx-linalg
gridaxGeoNumerics, 1090gaussx-linalg
gauss-flows-modelsGeoML, 00514gaussx-linalg, gaussx-infer
kernellibGeoML, 13240gaussx-sketch, gaussx-linalg
pyrox-gaussGeoML, 101412gaussx-linalg, gaussx-infer
filteraxGeoML, 20829gaussx-linalg, gaussx-infer
manipyGeoML, 2030gaussx-linalg
pyrox-gpGeoML, 302533gaussx-linalg, gaussx-infer
pyrox-lgmGeoML, 301820gaussx-linalg, gaussx-infer
pyrox-nnGeoML, 3070gaussx-linalg
pyrox-ssmGeoML, 30533gaussx-linalg, gaussx-infer
vardaxGeoML, 30164gaussx-linalg, gaussx-infer
radtraxGeoModels, 0172all three
sesmax-coreGeoModels, 0040gaussx-linalg
sesmax-oceanGeoModels, 0030gaussx-linalg
sesmax-paramGeoModels, 0001gaussx-infer
plumaxGeoModels, 1043gaussx-linalg, gaussx-infer
somax (archived)not in the graph010none: no issue is filed
optax_bayes (being retired)not in the graph040none: 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.pygaussx_linalg
_gmrf, as _buildersgaussx_linalg
_distributions/_project.py; quadratic_form and add_jitter of _distributions/_gaussian.pygaussx_linalg, in _linalg
the four curvature names of _inference/_natural_gradient.py and _inference/_blr.pygaussx_linalg, in _operators and _primitives
UDLDecomposition and udl_decomposition of _ssm/_udl.pygaussx_linalg, in _linalg
_distributions, _expfam, as _gaussiansgaussx_infer
_quadrature, _gpgaussx_infer
_ssm, with _gp/_interpolation.py (it smooths a state-space model) and the two udl_*_ssm_params conversionsgaussx_infer
the seven ensemble files of _inference, as _ensemblegaussx_infer
the rest of _inference, as _approximategaussx_infer
mixture_quantile_gaussian_approx of _primitives/_quantile.pygaussx_infer, in _gaussians; the rest of the file and _primitives/_chandrupatla.py leave gaussx (GX-D6)
_testing.pydivided: the operator and tolerance helpers to gaussx_linalg, empirical_moments and assert_sample_moments to gaussx_infer
__init__.pydivided 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:

  1. Nyström. randomized_nystrom is divided into nystrom_factors, which returns (U, γ̂) and goes to the sketch package, and the wrapper that builds the LowRankUpdate, which stays with the operator in gaussx-linalg under the name randomized_nystrom. Its result is unchanged.

  2. Hutch++. hutchpp_trace moves from _randomized/_trace.py to _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.

  3. symmetrize. The two sketch modules that call it take a private one-line helper of their own; the public symmetrize stays in gaussx-linalg.

  4. Pivoted Cholesky. _preconditioners/_partial_cholesky.py imports the private _pivoted_cholesky of _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_iterLargest relative error of the singular valuesSine of the largest principal angle
01.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

ConsumerWith 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 pingaussx-linalg and its import name, at the split
the nine othersnothinggaussx-infer and up to three import names, at the split
pyroxtwo private imports (gaussx._deprecation.GaussxDeprecationWarning, gaussx._linalg._diag_inv._diag_inv_structured) get public homes firstthe same
functaxthe svd argument; no dependency on gaussxthe same
geostackthree or four packages for gaussx in the graph, guards regeneratedthe 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

GatePasses when
GX-G1 cutno package imports one below it in the table of “Decision”
GX-G2 namesthe public names of 0.8.4 are all still importable, as the same objects
GX-G3 sketchgaussx-sketch installs with JAX, Equinox, lineax, einx and jaxtyping alone
GX-G4 lightimporting a package loads no module of a package below it in the table
GX-G5 consumersthe thirteen live consumers’ tests pass
GX-G6 graphgeostack’s dependency check passes, with no tier changed
GX-G7 functaxEOFs 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.

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.

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

15Follow-up issues

Filed on 3 Dec 2026 under the epic gaussx#922, each written to be read on its own.

StepIssueDoesGate
X1gaussx#923the four changes that cut the sketch part free, with a guard testGX-G1 for the sketch modules
X2gaussx#924, pyrox#608public homes for the two private imports, and pyrox on themGX-G5
X3gaussx#925, gaussx#926the folders follow the rule: matrix code out of the Gaussian folders, then the renamesGX-G1 inside one package
X4gaussx#928the decision GX-O1, closed as GX-D9none
X5gaussx#927the workspace conversion, with no behaviour changeGX-G1 to GX-G4
X6geostack#361the packages in the graph, guards regenerated, pins movedGX-G6
X7functax#206eof_basis(..., svd=...)GX-G7
X8integrix#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#336each consumer declares and imports the packages it usesGX-G5
X9gaussx#929, kernellib#325, kernellib#326, filterax#223, gaussx#930, functax#208, kernellib#327, pyrox#610, gaussx#931the 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

IDDecisionStatus
GX-D1gaussx becomes a uv workspace of three packages: sketch, linear algebra and Gaussian inferencedecided 2 Dec 2026
GX-D2the names gaussx-sketch, gaussx-linalg and gaussx-inferdecided 2 Dec 2026
GX-D3functax does not import gaussx; eof_basis takes the truncated SVD as an argumentdecided 2 Dec 2026
GX-D4gaussx-linalg is not cut further: it is one import cycledecided 3 Dec 2026
GX-D5a module is placed by what it computes (a probability law, or not), not by its folder; the moves of “What moves” followdecided 3 Dec 2026
GX-D6the bracketed inverse of a CDF and its root finder are gauss-flows-maps’s; gaussx removes mixture_quantile and Chandrupatladecided 3 Dec 2026
GX-D7great-circle distance is geophysix’s; kernellib calls it and gaussx removes haversine_distancedecided 3 Dec 2026
GX-D8the localisation tapers are kernellib’s; localized_kalman_gain stays in gaussxdecided 3 Dec 2026
GX-D9the 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-D10functax 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-O2functax imports gaussx-sketch behind an extra, with Core’s tiers moveddeferred until a second use in functax
GX-O3a finer cut of the Gaussian packagedeferred

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

References
  1. 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
  2. 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.