Release notes#

The full changelog is reproduced below, newest first; the format follows Keep a Changelog and versions are YYYY.MINOR.PATCH (a calendar year, then a minor number that increments with each release of that year). Start with the upgrade notes if you are moving an existing codebase forward.

Upgrading from 2026.4.0#

The frame stores up and down have swapped names: a name that kept its spelling now means the other store, and it need not raise. frame.up_ranks was the Tucker factors’ ranks and is now the up cores’ mode legs; UT3Frame.nU was the padded Tucker width and is now the up store’s. At a minimal frame the two stores agree, so such code even returns the right numbers there: search for the names below rather than waiting for an error. When a stale width keyword does raise (a swapped width below the other store’s ranks), the error comes from inside numpy and does not name the width.

Why. A store is now named for the side of its edge that its cores occupy, as left and right always were. Draw the TT chain on top and the Tucker factors below it: the up store is the TT-shaped cores above each Tucker edge (up-orthogonal), the down store the Tucker factors below it (down-orthogonal). The 2026.4.0 words named where the cores’ edges point, the opposite way, and disagreed with the method names up_orthogonalize_tt_cores and down_orthogonalize_tucker_cores, which are unchanged. See Four rank stores.

2026.4.0

2026.5.0

raises if left?

up_ranks / down_ranks (T3Frame, T3FrameWeights, UT3Frame, UT3Variations, UT3FrameWeights)

down_ranks / up_ranks

no

T3FrameWeights.up_weights / down_weights (fields and keywords)

down_weights / up_weights

no

UT3FrameWeights.up_weight_supercore / down_weight_supercore (fields and keywords)

swapped

no

UT3FrameMasks.up_mask / down_mask (fields and keywords)

swapped

no

UT3VariationsMasks.variations_up_mask / variations_down_mask (fields and keywords)

swapped

no

keywords up_ranks= / down_ranks= (ranks.frame_has_minimal_ranks, ufv_masking.ufv_make_frame_masks)

swapped

no

properties nU / nD (UT3Frame, UT3Variations, UT3FrameWeights)

nD / nU

no

keywords nU= / nD= (the four from_* converters, ufv_conversions.*_to_ut3*, ufv_make_frame_masks)

nD= / nU=

no (it need not)

T3Frame.up_tucker_cores / down_tt_cores (fields and keywords)

down_tucker_cores / up_tt_cores

yes

UT3Frame.up_tucker_supercore / down_tt_supercore

down_tucker_supercore / up_tt_supercore

yes

keywords up_tucker_cores[_dot]= / down_tt_cores[_dot]= (probing.compute_*, sampling_derivatives.compute_*_jets)

down_tucker_cores[_dot]= / up_tt_cores[_dot]=

yes

update='ULRO' / 'UL' / 'RO' (T3Tangent.align_padded, UT3Tangent.align_padded, tv_align_padded_frame, utv_align_padded_frame)

('D', 'U', 'L', 'R') / ('D', 'L') / ('U', 'R')

yes for a str; see below

Migrate in one pass. Two sed passes undo each other. Swap every name at once, longest first, and only these (never a *_orthogonalize_* or *_svd* name, whose words are unchanged):

import re
SWAP = {'up_tucker_cores': 'down_tucker_cores', 'down_tt_cores': 'up_tt_cores',
        'up_tucker_cores_dot': 'down_tucker_cores_dot', 'down_tt_cores_dot': 'up_tt_cores_dot',
        'up_tucker_supercore': 'down_tucker_supercore', 'down_tt_supercore': 'up_tt_supercore',
        'up_ranks': 'down_ranks', 'down_ranks': 'up_ranks',
        'up_weights': 'down_weights', 'down_weights': 'up_weights',
        'up_weight_supercore': 'down_weight_supercore', 'down_weight_supercore': 'up_weight_supercore',
        'up_mask': 'down_mask', 'down_mask': 'up_mask',
        'variations_up_mask': 'variations_down_mask', 'variations_down_mask': 'variations_up_mask',
        'nU': 'nD', 'nD': 'nU'}
pattern = re.compile(r'\b(' + '|'.join(sorted(SWAP, key=len, reverse=True)) + r')\b')
source = pattern.sub(lambda m: SWAP[m.group(1)], source)    # then review the nU/nD hits: they may be your own names

\b treats _ as a word character, so up_mask does not match inside variations_up_mask, nor up_tucker_cores inside up_tucker_cores_dot (hence its own entry). rL and rR are unchanged. Your own nU/nD locals are swapped along with the keywords, which keeps them consistent.

update needs a hand edit. It takes a tuple of the new store letters, any order: 'D' down, 'U' up, 'L' left, 'R' right. Swap each old letter ('U' → 'D', 'O' → 'U'; 'L' and 'R' stay) and split: 'ULRO' → ('D', 'U', 'L', 'R') (the default), 'UL' → ('D', 'L'), not ('U', 'L'), which now updates the up store; 'RO' → ('U', 'R'). Every str raises:

ValueError: update must be a non-empty tuple of the store letters 'D', 'U', 'L', 'R' without repeats (D down, U up, L left, R right), e.g. ('D', 'L'); got 'ULRO'; that is the 2026.4.0 form, whose 'U' was the Tucker store (now 'D') and 'O' the TT-shaped store (now 'U'): swap each letter and pass a tuple, e.g. 'UL' -> ('D', 'L'), not ('U', 'L'), which now means up and left

A tuple or list of the old letters, which 2026.4.0 also accepted, raises only if it holds 'O': convert it the same way, or it runs with the new meaning.

What does not change. Positions: T3Frame.data and every rank, mask, weight and uniform tuple keep their order, which now reads (down, up, left, right), so up, down, left, right = frame.data keeps working (rename the locals to read right), and so do positional width calls (UT3Frame.from_t3frame(F, N, 7, 5)). Saved files load unchanged. Every number is bit-identical, seeded starts included. The orthogonalization and SVD method names, every optimizer keyword and every other public name are unchanged.

Letters. Diagrams, equations and shape comments write D, U, L, R and the widths nD, nU, rL, rR; a T3’s own cores are B, G; a variation-shaped array is V or H by its shape; the jet shift is sh / shᵀ and the derivative an upright d. Docs before 2026.5.0 wrote U for the Tucker factor and O for the TT-shaped core. T4S writes U, O, P, Q for our D, U, L, R; its δU is our V (tucker_variations), its δG our H (tt_variations).

Also new, and opt-in. newton_cg(timing=True) splits each Newton row’s wall time by phase (fitting_and_optimization.md §4.13), and newton_cg(hessian='switch') starts with Gauss-Newton and switches to the exact Hessian (§4.14). Without them, every number a run returns is 2026.4.0’s.

Upgrading from 2026.3.0#

Nothing breaks. Every addition is opt-in, and no default changes: the Newton reference stays 'zero', and a newton_cg call without the new keywords returns bit-identical stats. What is new, and when to reach for it:

  • The aligned start after a rank increase. Pass the previous level’s point to newton_cg(..., padded_from=x_old). Iteration 0 then linearizes at the frame of x0 (that point, zero-padded) whose new directions are aligned with the misfit gradient. padded_max_passes=0 gives the cheap hint-free start instead. The other padded_* keywords (padded_oversampling, padded_oversampled_passes, padded_tol, padded_alternate, padded_seed) tune the alignment; stats['start_frame'] and stats['start_movements'] record it. start_frame=F takes a frame you built.

  • The cone reference. g0_reference='cone' (for newton_cg and gradient_descent) measures ‖g₀‖ at the zero tensor on the frame aligned with the data gradient there. It is larger than 'zero' (20–100× on the measured Darcy fits), so the same gtol_rel stops looser; lower gtol_rel with it if you want the old stopping point. Its options are the cone_* keywords, and stats['cone_movements'] records the passes.

  • With jax arrays, pass use_jit=True. The alignment otherwise compiles every operation of each new structure eagerly, which is slow on the first call and can exhaust the process memory-map limit over a long rank continuation.

  • Both need a manifold geometry (MANIFOLD, UNIFORM_MANIFOLD or a shared wrapper of one). On the uniform layer, padded_from must be padded to x0’s N: UniformTuckerTensorTrain.from_t3(x_old, N=x0.N).

A rank continuation that adopts both (the pattern of the downstream T3Polynomial ladder):

x_old = None
for level in range(max_levels):
    kw = dict(g0_reference='cone', gtol_rel=gtol)
    if x_old is not None:
        kw['padded_from'] = x_old                     # align the new directions with the misfit gradient
    x, stats = newton_cg(MANIFOLD, kind, sample, data, x, **kw)
    new_tucker, new_tt = x.continuation_ranks()
    if (new_tucker, new_tt) == (x.tucker_ranks, x.tt_ranks):
        break
    x_old, x = x, x.resize(x.shape, new_tucker, new_tt)

On the first level there is no previous point, so leave out padded_from and every padded_* option: the optimizer rejects padded_* options given without padded_from. The new frame functions (T3Frame.padded, fv_aligned_padded_frame and their uniform twins, T3Tangent.align_padded, backend.optimizers.padded_start) are for custom optimizers. See aligned_padded_frame.md for the method, the measured results, and the jit-or-eager costs.

Upgrading from 2026.2.0#

Most code runs unchanged; the exact Hessian is opt-in (newton_cg(..., hessian='exact'), Gauss-Newton stays the default). What can break, roughly by how likely you are to meet it:

The default Newton reference moved (manifold geometries). newton_cg’s relative stop and CG forcing term, and gradient_descent’s stop, are now relative to the gradient norm at the zero tensor of x0’s ranks (g0_reference=None, resolved to 'zero'), not the warm-start ‖g(x0)‖. Every manifold run stops at a slightly different point – an O(1) factor in the reference, zero starts included. To keep the 2026.2.0 behaviour pass g0_reference='warm_start'; the explicit g0norm_newton / g0norm_cg overrides still win (and must now be > 0: a non-positive value raises ValueError). Corewise geometries keep the warm start.

Delete your reference bookkeeping. A continuation loop that carried stats['history'][0]['gnorm'] from one level into the next level’s g0norm_newton can drop it: the default reference is already per level and at the level’s own scale. If a loop passed g0norm_newton=None meaning “use the warm start”, that now gets the zero reference – say g0_reference='warm_start' instead. A cold start at zero (TuckerTensorTrain.zeros(...) as x0) remains available at every level, in either Hessian mode; its default reference is the same as the warm start’s at those ranks.

stats['newton'] is gone; read stats['newton_steps'] (the same count: CG solves). Beside it are stats['newton_accepted'] (steps taken) and stats['stop_reason'].

Two stats['history'] fields read differently under the trust region. A trust-region row (step_control='trust_region', the default with hessian='exact') has ls_steps = ls_failed = None and alpha = 1.0, so code that sums ls_steps should filter rows on step_control. cg_truncated no longer counts a trust-region boundary stop (a Steihaug stop on nonpositive curvature is a boundary step, reported in the new cg_boundary). With the default line search there is no boundary, so Gauss-Newton runs read both fields exactly as before.

fitting.GaussNewtonModel is now fitting.LocalModel (and t3toolbox.LocalModel at the root). It is renamed, not aliased, so the old name raises AttributeError / ImportError; rename it where you spell it. The six *_model factories, the model’s methods and its fields are unchanged, so code that only calls the factories needs no change. The new name mirrors the backend class it wraps, backend.optimizers.LocalModel.

optimizers._setup is gone; use optimizers.least_squares_problem. It takes the same arguments (geometry, kind, sample, data, x0, order, weight, regularizer, chunk_size, batch, plus hessian) and returns a named LeastSquaresSetup instead of a 3-tuple, so read its fields rather than unpacking:

setup = optimizers.least_squares_problem(geometry, kind, sample, data, x0, order=order, weight=weight)
lm = setup.problem.local_model(setup.x0_cores)       # was: problem, init, rewrap = optimizers._setup(...)

setup.problem.geom is the backend geometry that the private optimizers._geometry_ops(...) used to give you; _geometry_ops stays private.

optimizers.newton_cg takes explicit keywords only. Every valid call is unchanged; a misspelt option now raises TypeError at the call instead of failing later inside the backend.

Custom kinds and geometries keep working for Gauss-Newton. To use them with hessian='exact', a SamplingKind adds the sixth operation corewise_hessian (the derivative of its transpose along raw core directions), and a geometry the four exact-mode members curvature_precompute, lift, lift_transpose and tangential_curvature (the Geometry protocol in backend/optimizers.py); without them an exact model raises a structural error naming what is missing. A geometry may also add zero_point_frame (optional, looked up duck-typed): without it the default reference is the warm start, as in 2026.2.0.

Backend callers of the jet kernels (backend.sampling_derivatives): the trs arguments are gone (the order is read off the jets, or passed as order), compute_dxi_tilde_jets returns only its two read rows, and binomial_combine_tensor and the dense *_trs kernels are removed. Code that only calls the transposes, the forwards or the optimizers is unaffected. estimate_chunk_size / max_chunk_size_within now measure the compiled chunked program, so they return larger chunks and chunk_size='auto' chunks less.

Uniform transposes return exact zeros in their padding. Results that respect “padding is don’t-care” are bit-identical; only code that read the padded slots sees a difference.

The safe-mode gauge check is scaled by the operands. MANIFOLD.norm(a - b) / inner (and the uniform twins) no longer reject a near-cancelling difference of gauged tangents, such as a finite-difference check of a Hessian. A tangent built by + / - / scalar * / stack_tangents is checked against its operands’ scale; a tangent computed directly (a projection, a gradient) keeps the self-relative check, so the check is never stricter than before. Its documented limit: dividing a finite-difference quotient by its step divides the recorded scale too, so to certify a computed tangent’s gauge, check that tangent itself (see numerical_contracts.md). Backend callers of tv_gauge_residual / utv_gauge_residual get the old behaviour bit for bit unless they pass the new scale=.

Upgrading from 2026.1.0#

The optimization layer’s axis objects became classes. Everything here raises rather than failing silently, and the constructor spellings you already use mostly still work.

Geometries moved and are constructed, not fetched. backend.optimizers.MANIFOLD_OPS becomes backend.geometry.ManifoldGeometryOps(), COREWISE_OPS becomes CorewiseGeometryOps(), and shared_geometry_ops(base, groups) becomes base.with_sharing(sharing, shape) (ragged; the uniform twins take with_sharing(sharing) – they carry their shape already). On the uniform side, uniform_geometry_ops(name, x0_data, sharing) becomes UniformManifoldGeometryOps.from_point(x0_data, sharing) (or the Corewise twin). The frontend geometry singletons – MANIFOLD, COREWISE, UNIFORM_MANIFOLD, UNIFORM_COREWISE, shared_manifold(...) – are untouched, so ordinary fitting code needs no change.

A custom sampling kind is a subclass now. Building one by copying an existing kind and swapping a function – dataclasses.replace(APPLY, forward=...) – no longer type-checks. This is deliberate: that construction copied the kind’s identity along with it, so the variant claimed to be APPLY and jit handed back APPLY’s compiled program. Subclass ApplyKind (or the relevant base) and override the operations you need; keep your parameters as dataclass fields and you get correct jit cache behaviour for free.

A custom backend geometry needs three more members. The 2026.0.0 notes below show a geometry object with frame / project / retract / inner / precompute = None. The optimizers now also call stack_shape(x_cores) (returns the frame stack C, used by the stacked-point guard) and base_point(frame) (the point the frame is attached to, used by the regularizer), and precompute must be a callable returning None rather than None itself. Adding the three reproduces the old behaviour exactly. The full surface is the Geometry protocol in backend/optimizers.py.

The six uniform kind builders are gone. uniform_apply_kind(x0_data) and its five siblings become UniformApplyKind.from_point(x0_data) and theirs; the uniform_sampling_kind(name, x0_data, weight) / uniform_derivatives_kind(name, x0_data, order, weight, chunk_size) dispatchers are unchanged and are the easier route. The four ragged constructors (probe_kind, the three *_derivatives_kind) keep both their positional and their weight= keyword spellings.

fitting.UniformGaussNewtonModel is gone. One GaussNewtonModel (renamed LocalModel in 2026.3.0, above) now serves both representations, and the *_model factories still dispatch on x, so fitting.apply_model(UNIFORM_MANIFOLD, ux, ...) returns what it always did – just of the merged type. If you were checking isinstance(m, UniformGaussNewtonModel), check the frame instead: isinstance(m.frame, t3toolbox.UT3Frame).

Stacked points raise in the optimizers. If you were passing a stacked x0 to newton_cg, gradient_descent, mc_sgd or adam, you were getting a TypeError from inside the loop; you now get a NotImplementedError at the entry that says what to do. Fit the stack elements separately, or build the local model and drive your own loop – that path supports stacked points and returns a shape-C objective. A regularizer on a stacked point raises for a separate reason (see the changelog).

Upgrading from 2026.0.0#

Three changes in this release can break existing code. All three are mechanical, and each raises a clear error rather than failing silently.

The named contraction functions are gone. backend.contractions used to export ~104 functions whose names spelled their own subscripts (WCa_Caib_WCi_to_WCb and relatives). They are replaced by one interpreter, contract, and the migration is a direct rewrite — the function name is the subscripts string:

from t3toolbox.backend.contractions import contract

# before:  WCa_Caib_WCi_to_WCb(mu, G, xi, n_probe, n_frame)
# after:
contract('WCa,Caib,WCi->WCb', mu, G, xi, len_W=n_probe, len_C=n_frame)

A trailing n_probe / n_frame argument becomes the keyword len_W= / len_C=, and you only need to supply one when the subscripts alone cannot pin the split — the error message names exactly which. The results are numerically identical (each named function was checked against its contract call before removal). See grouped_contractions.md.

A custom GeometryOps must accept aux. The backend geometry protocol gained an optional precompute(frame) slot, and project / retract now take a third argument. If you implement your own geometry, accept and ignore it:

def project(frame, variations, aux=None): ...
def retract(frame, variations, aux=None): ...
precompute = None          # or a callable frame -> whatever project/retract need

The slot exists so a geometry with expensive per-frame setup pays for it once per local model instead of once per Hessian matvec; the built-in geometries pass None. Rationale: contributor/precompute_and_caching.md.

A custom Regularizer must accept aux. Same shape of change, for the same reason: gradient(geom, frame, aux=None), hessian(geom, frame, p, aux=None) and quadratic(geom, frame, p, aux=None) now receive the geometry aux, so a regularizer composed with a shared-factor geometry reuses the frame companion instead of rebuilding it per matvec. Accept and ignore the parameter if you do not need it.

One behavior change worth knowing about, which is not a signature break: use_jit=True now moves your inputs onto jax rather than silently running eager when they are numpy. Runs that previously reported “jit” timings while executing eagerly will now genuinely compile, return jax-backed results (float32 unless you enable jax_enable_x64), and, since 2026.2.0, warn and run eager if jax is not installed. If you were relying on the old behavior you were not getting jit; see fitting_and_optimization.md §4.5.

[2026.5.0] — 2026-11-15#

Three headlines. The store rename (breaking): the frame stores up and down swap names, so that a store is named for the side of its edge that its cores occupy, as left and right always were. Some names keep their spelling and now mean the other store, so stale code need not raise. Every number is bit-identical; names, letters and messages change. Upgrade notes: docs/release_notes.md, “Upgrading from 2026.4.0”. Phase timing for newton_cg (timing=True): each row’s wall time split into phases (the local model’s build, the gradient, CG, the trials, the callback, the rest), with jax’s compile wait beside each, at a cost within the run-to-run noise (user guide: docs/fitting_and_optimization.md §4.13). Starting with Gauss-Newton and switching to the exact Hessian (hessian='switch'): newton_cg switches for good once the exact model has predicted the objective clearly better on consecutive steps (§4.14). Both additions are opt-in; no default changes.

Measured (the switch; A100, the uniform layer under use_jit in x64, gtol_rel=1e-3 on the default 'zero' reference, at most 300 Newton steps a level, the Darcy rank-continuation ladder of the downstream T3Polynomial project, 2026-11-14). On 10 points × 100 directions (six levels to rank 24) from the library’s own start frame, the switch took 223 Newton steps and 6,303 CG iterations in 177 s (net of compile and display), against 267 / 10,751 / 275 s for hessian='exact' and 1,625 / 24,682 / 427 s for Gauss-Newton with the line search (the default), which stopped at the step cap on 4 of the 6 levels; in Gauss-Newton apply-equivalents at measured cost, 19,794 against 33,309 and 24,682. It switched on every level after 5–8 Gauss-Newton steps, its tracking took 3 % of its time, and at the level the validation error selected its errors were no worse than Gauss-Newton’s. The same pair on a laptop CPU agreed: 219 against 277 Newton steps, 13,068 against 16,777 s. It is not a uniform win: restarted from the aligned frame (padded_from), the exact Hessian took 231 Newton steps to the switch’s 303, and at 20 points × 1000 directions (eleven levels, inner TT rank to 50) the two were even at both starts (switch / exact 287 / 291 Newton from the library start, 308 / 288 from the aligned), with the same best test error.

Changed — breaking#

  • The frame stores up and down have swapped names: a name that kept its spelling now means the other store. These are listed first because nothing catches them: they need not raise, and when one does the message does not name the width. Same spelling, other store:

    • up_ranks / down_ranks (T3Frame, T3FrameWeights, UT3Frame, UT3Variations, UT3FrameWeights);

    • T3FrameWeights.up_weights / down_weights, UT3FrameWeights.up_weight_supercore / down_weight_supercore, UT3FrameMasks.up_mask / down_mask and UT3VariationsMasks.variations_up_mask / variations_down_mask (dataclass fields, so also constructor and dataclasses.replace keywords);

    • the up_ranks= / down_ranks= keywords of ranks.frame_has_minimal_ranks and ufv_masking.ufv_make_frame_masks;

    • the width properties nU / nD (UT3Frame, UT3Variations, UT3FrameWeights) and the width keywords nU= / nD= (UT3Frame.from_t3frame, UT3Variations.from_t3variations, UT3FrameWeights.from_t3frameweights, UT3Tangent.from_t3tangent, ufv_conversions.t3frame_to_ut3frame, t3variations_to_ut3variations, t3frameweights_to_ut3frameweights, ufv_masking.ufv_make_frame_masks). nD is now the down store’s width (the Tucker factors’ rows) and nU the up store’s (the TT-shaped cores’ mode leg).

    At a minimal frame both stores have the same ranks, so stale code returns plausible numbers and is wrong only at slack. A stale width keyword pads the other store; it raises only when the swapped width is below that store’s ranks, and then from inside numpy (index can't contain negative values). The new meaning: the up store is the TT-shaped cores above each Tucker edge (up-orthogonal, built by up_orthogonalize_tt_cores), the down store the orthonormal Tucker factors below it (down-orthogonal, down_orthogonalize_tucker_cores). In 2026.4.0 the two words named the direction the cores’ edges point, which is the other way round and disagreed with those method names. Not aliased, as for GaussNewtonModel in 2026.3.0: a meaning swap cannot be aliased.

  • Renamed, so stale code raises (AttributeError or TypeError): T3Frame.up_tucker_cores → down_tucker_cores and T3Frame.down_tt_cores → up_tt_cores (dataclass fields, so also constructor and dataclasses.replace keywords); UT3Frame.up_tucker_supercore → down_tucker_supercore and UT3Frame.down_tt_supercore → up_tt_supercore; the backend keywords up_tucker_cores[_dot]= → down_tucker_cores[_dot]= (probing.compute_xi, compute_deta_tilde, compute_deta_tilde_tangent; sampling_derivatives.compute_deta_tilde_jets, compute_deta_tilde_tangent_jets) and down_tt_cores[_dot]= → up_tt_cores[_dot]= (probing.compute_eta, compute_sigma, compute_tau, compute_dxi_tilde, compute_dxi_tilde_tangent; sampling_derivatives.compute_sigma_jets, compute_tau_jets, compute_dxi_tilde_jets, compute_dxi_tilde_tangent_jets).

  • update takes a tuple of single store letters in the new meaning (T3Tangent.align_padded, UT3Tangent.align_padded, padded_frames.tv_align_padded_frame, uniform_padded_frames.utv_align_padded_frame): 'D' down, 'U' up, 'L' left, 'R' right, any order, default ('D', 'U', 'L', 'R'); the two-colour passes are ('D', 'L'), then ('U', 'R'). Convert a 2026.4.0 string letter by letter ('U' → 'D', 'O' → 'U', 'L' and 'R' kept) and split it: 'ULRO' → ('D', 'U', 'L', 'R'), 'UL' → ('D', 'L'), 'RO' → ('U', 'R'). Every str raises:

    ValueError: update must be a non-empty tuple of the store letters 'D', 'U', 'L', 'R' without repeats (D down, U up, L left, R right), e.g. ('D', 'L'); got 'ULRO'; that is the 2026.4.0 form, whose 'U' was the Tucker store (now 'D') and 'O' the TT-shaped store (now 'U'): swap each letter and pass a tuple, e.g. 'UL' -> ('D', 'L'), not ('U', 'L'), which now means up and left
    

    A tuple or list of the old letters, which 2026.4.0 also accepted, raises only if it holds 'O'; otherwise it runs with the new meaning: ('U', 'L') now updates the up and left stores.

  • Migrate in one pass. Two sed passes undo each other. Swap every name at once, longest first, and only these (never a *_orthogonalize_* or *_svd* name, whose words are unchanged):

    import re
    SWAP = {'up_tucker_cores': 'down_tucker_cores', 'down_tt_cores': 'up_tt_cores',
            'up_tucker_cores_dot': 'down_tucker_cores_dot', 'down_tt_cores_dot': 'up_tt_cores_dot',
            'up_tucker_supercore': 'down_tucker_supercore', 'down_tt_supercore': 'up_tt_supercore',
            'up_ranks': 'down_ranks', 'down_ranks': 'up_ranks',
            'up_weights': 'down_weights', 'down_weights': 'up_weights',
            'up_weight_supercore': 'down_weight_supercore', 'down_weight_supercore': 'up_weight_supercore',
            'up_mask': 'down_mask', 'down_mask': 'up_mask',
            'variations_up_mask': 'variations_down_mask', 'variations_down_mask': 'variations_up_mask',
            'nU': 'nD', 'nD': 'nU'}
    pattern = re.compile(r'\b(' + '|'.join(sorted(SWAP, key=len, reverse=True)) + r')\b')
    source = pattern.sub(lambda m: SWAP[m.group(1)], source)    # then review the nU/nD hits: they may be your own names
    

    \b treats _ as a word character, so up_mask does not match inside variations_up_mask, nor up_tucker_cores inside up_tucker_cores_dot (hence its own entry). rL and rR are unchanged. The update strings need the hand edit above.

  • What does not change. Positions: T3Frame.data and every rank, mask, weight and uniform tuple keep their order, which now reads (down, up, left, right), so up, down, left, right = frame.data keeps working (rename the locals to read right), and so do positional width calls (UT3Frame.from_t3frame(F, N, 7, 5)). Saved files load unchanged (save/load key arrays by position). Every number is bit-identical, seeded padded_seed / cone_seed streams included. The orthogonalization and SVD method names (down_orthogonalize_tucker_cores, up_orthogonalize_tt_cores, up_svd, …), every optimizer keyword, and every other public name are unchanged.

  • Text only: the reprs (T3Frame(… down_ranks=…, up_ranks=…), UT3Frame(… nD=…, nU=…)) and every error message that names a store use the new words.

Changed#

  • Letters in the docs, docstrings and math notes. Diagrams, equations and shape comments write the stores D, U, L, R with widths nD, nU, rL, rR (docs/frame_variations.md, “Four rank stores”); a T3’s own cores B, G (the corewise frame is (B, G, G, G): B substituted for D, G for U, L, R); a variation-shaped array V or H by its shape, whatever computed it (e.g. the transposes’ outputs V_tilde, H_tilde); the jet shift sh / shᵀ (was D / U; the functions _shift_down / _shift_up keep their names); the derivative an upright d (dΦ); edge variables’ travel directions with -ward (upward, adjoint-upward), so a bare up or down always names a store. All six math notes are converted, the T4S-notation ones included; each states the correspondence once: T4S writes U, O, P, Q for our D, U, L, R; its δU is our V (tucker_variations), its δG our H (tt_variations). Docs and changelog entries before 2026.5.0 wrote U for the Tucker factor and O for the TT-shaped core.

Fixed#

  • The verbose display names the 'cone' reference. A converged newton_cg row with g0_reference='cone' ended “converged (‖g‖ ≤ gtol·‖g₀‖)”, naming no reference; it now ends “…, g₀ = cone (aligned zero tensor))”, as the other references do.

  • Messages. Eight runtime error messages no longer end with an internal review code, and the ones that named a “sample stack” or an “A-block” now say probe stack and old block, the words the docs use (docs/glossary.md).

Added#

  • Phase timing for newton_cg: timing=True (keyword-only, after cone_seed; backend and frontend, which forwards it only when set). Each history row’s wall_time window is split into phases: the local model’s build (frame, sweep, companion, residual, curvature), gradient, row 0’s reference, cg, forms, every trial’s trial_retraction and trial_objective, the previous row’s callback and a remainder; on a jax run each phase also carries jax’s compile wait (from jax.monitoring; None on numpy and on jax 0.4.30, which cannot unregister a listener). The run’s one-offs are recorded too: the setup, padded_from’s alignment, the seconds per pass of the alignment and of the 'cone' reference, the last callback. It changes no number: x and every other stats field are bitwise the untimed run’s, the wall_time clock readings aside. With timing=False (the default) nothing is read or synchronized and every output, the display included, is the untimed run’s (clock readings aside). User guide: docs/fitting_and_optimization.md §4.13.

    • NewtonInfo.timing: a NewtonTiming per row (window, seconds and compile_seconds as PhaseSeconds, trials, accepted_retraction; row 0 adds the one-offs), None when off; not a history field. Both records are in backend.optimizers. (PhaseSeconds.tracking times the hessian='switch' tracking product, below.)

    • stats['timing'], a plain dict: total, setup, alignment, alignment_passes, reference_passes, last_callback, phases, compile, cg_per_iteration, rows; total is the sum of the setup, the alignment, the rows’ windows and the last callback.

    • The display (verbose=True, backend.optimizer_display.make_newton_display): a time line under each timed row’s header and a closing table after the run’s last row.

    • The geometry members aligned_padded_frame(..., timing=False), ragged and uniform: timing=True adds a third element, the seconds per pass (None under the uniform whole-loop jit). The optimizers pass timing only to a member whose signature names it, so a custom member without it keeps working.

    • backend.common.tree_block_until_ready(tree): wait for every jax array in a pytree (a no-op without one).

    • Cost. Every phase waits for its results, which serializes a jax run. Measured on a laptop CPU (AMD Ryzen 7 3700U; numpy 2.4, jax 0.10.2 in x64), timing on against off differed by −4 % to +2 % on numpy, eager jax and use_jit, ragged and uniform, at d = 3 and d = 6: within the run-to-run noise. On an A100 GPU the same cases and a downstream level differed by −1.4 % to +3.1 %, also within the noise.

  • Starting with Gauss-Newton and switching to the exact Hessian: newton_cg(hessian='switch') (backend and frontend). The run starts with Gauss-Newton and switches to the exact Hessian for good once the exact model has predicted the objective clearly better: after each countable step (the full model step taken: an accepted trust-region trial, or an Armijo step with α = 1), one curvature product gives the exact model’s miss e_N = |Δf − m_N(s)| beside Gauss-Newton’s e_GN = |Δf − m_GN(s)|, and switch_k consecutive steps with e_N < switch_tau·e_GN switch, from the next point on (defaults: four times better, twice running). A miss, a rejected trust-region trial, a line-search backtrack, the −g fallback, a step forced by on_line_search_failure='accept', or two errors at the objective’s rounding level (1000·ε·(‖ω⊙y‖·‖ω⊙r‖ + |f|), ε the residual dtype’s) resets the count. The default step control is the trust region, whose radius carries across the switch; each call starts in Gauss-Newton. Before the switch the run is the Gauss-Newton run with the same step control, step for step; after it, the exact run resumed at that point. The rule comes from the maintainer’s nicks-optimizers (https://github.com/NickAlger/nicks-optimizers). User guide: docs/fitting_and_optimization.md §4.14.

    • Four keyword-only options after timing, each None by default and a structural error without hessian='switch': switch_tau (0.25; in [0, 1); 0 tracks and never switches), switch_k (2; an int ≥ 0; 0 is exact from iteration 0), switch_cg_forcing_power (1.0, the forcing power from the switch on; cg_forcing_power stays the Gauss-Newton phase’s) and switch_track ('countable', or 'all': the product on every Gauss-Newton-phase step, the non-countable ones reported but never counted). An option the run would not read raises too (switch_tau or switch_track with switch_k=0; switch_k or switch_cg_forcing_power with switch_tau=0).

    • The rows: NewtonInfo.hessian is now the row’s model ('gauss_newton' or 'exact'; the run’s mode, as before, outside switch mode). Five new fields, switch_e_gn, switch_pKp, switch_e_n, switch_count and switch_fired, are None outside switch mode and in stats['history'] only in switch mode. On a Gauss-Newton-phase row lm is the Gauss-Newton view of the point’s exact-mode build, and the row equals the pure Gauss-Newton run’s row apart from the switch_* fields and wall_time.

    • stats, in switch mode only: hessian ('switch'), switch_track and switched_at (the index of the first row whose model is exact; None if the switch never fired).

    • The display: each Gauss-Newton-phase step row’s header ends with sw <e_N/e_GN> ×<count>, the switching row with ⇒ exact. With timing=True the tracking product is the tracking phase (the track cell).

    • least_squares_problem(hessian='switch') sizes chunk_size='auto' as 'exact'. Problem.local_model and the fitting *_model factories keep their two modes (a model has one Hessian).

    • Cost: each Gauss-Newton-phase point is built once, in exact mode (one misfit transpose, as in either pure mode, plus the curvature data), and each tracked step adds one curvature product; under use_jit CG compiles at most two programs per call, the Gauss-Newton one shared with a pure Gauss-Newton run. With hessian other than 'switch' every run is bitwise unchanged.

    • Messages: the invalid-hessian messages of newton_cg and least_squares_problem list 'switch', and newton_cg’s curvature_damping with Gauss-Newton now reads “… only meaningful with hessian=’exact’ or ‘switch’”.

[2026.4.0] — 2026-11-10#

The headline is the aligned padded frame: after a zero-padded rank increase, newton_cg can start from a frame whose new directions are aligned with the misfit gradient (padded_from=x_old), and measure its relative stop against the gradient norm at the zero tensor on such a frame (g0_reference='cone'). The frame twins behind them are public on both layers. All of it is opt-in; no default changes. User guide: docs/aligned_padded_frame.md; mathematics: the math note docs/padded_frame_cone.pdf (source docs/padded_frame_cone.tex). Upgrade notes: docs/release_notes.md, “Upgrading from 2026.3.0”.

Measured (A100, exact Hessian, gtol_rel=1e-3, the Darcy rank-continuation ladder of the downstream T3Polynomial project, 2026-11-10). On 10 points × 100 directions (six levels), the Newton totals were 254 for the library’s own start frame with the 'zero' reference, 119 with 'cone', 110 for the hint-free padded start with 'cone' and 115 for the aligned start with 'cone'; CG totals 10,175 / 2,610 / 2,576 / 1,839. The reference, not the start, halves Newton: 'cone' was 20–100× larger than 'zero' there, so the same gtol_rel stops at a larger ‖g‖, with best test errors within 4 % (p50 0.0607–0.0631). Within 'cone', the aligned start took about 30 % fewer CG iterations than either other start, mostly at levels 3–5. At 20 points × 1000 directions (eleven levels, the same reference), the aligned start took 166 Newton / 4,130 CG against the hint-free start’s 191 / 4,719, with identical test error; a library-start run from 2026-11-01 (zero-type reference, another card) took 167 / 4,688. Every alignment stopped on the 10-pass cap, never on tol=0.05 (last movements 0.27–0.43): in practice padded_max_passes is the knob that sets the alignment’s cost.

Added#

  • newton_cg(..., start_frame=, padded_from=), keyword-only. start_frame=F linearizes iteration 0 at a frame of x0 that you built (checked structurally always; orthonormal and representing x0 in safe mode). padded_from=x_old builds iteration 0’s frame by aligning x0’s new directions with the misfit gradient, where x0 is x_old zero-padded; options padded_oversampling, padded_oversampled_passes, padded_max_passes, padded_tol, padded_alternate, padded_seed. padded_max_passes=0 is the cheap hint-free start. stats['start_frame'] ('given' / 'padded') and stats['start_movements'] record it. Manifold geometries only.

  • g0_reference='cone' for newton_cg and gradient_descent: the gradient norm at the zero tensor of x0’s ranks on the frame aligned with the data gradient there, like-for-like with the gradient norms the stop compares (use it with gtol_rel near 1e-4). Options cone_oversampling, cone_oversampled_passes, cone_max_passes, cone_tol, cone_alternate, cone_seed; stats['cone_movements'] records the passes. cone_max_passes=0 is the zero tensor’s hint-free start, which is a different frame from 'zero'’s.

  • The frame twins, ragged and uniform:

    • T3Frame.padded(x_old, tucker_ranks, tt_ranks, sharing=None, seed=0) / UT3Frame.padded(...): the hint-free padded frame (x_old’s frame in the leading slots, Gaussian slot-indexed seeds completing the new ones; the uniform twin returns the block layout and its split);

    • frame_variations_format.fv_aligned_padded_frame(x_old, tucker_ranks, tt_ranks, hint, ...) / uniform_frame_variations_format.ufv_aligned_padded_frame(...): the aligned padded frame for any hint (a T3 or a dense array, or a custom project), and the movement of every pass; the uniform twin returns the frame at a level’s widths;

    • T3Tangent.align_padded(...) / UT3Tangent.align_padded(...): one alignment pass (update selects the stores; 'UL' / 'RO' are the two colours).

  • The schedule of the loops: oversampled passes (oversampling=5 for oversampled_passes=2), one truncating pass, then two-colour ('UL', 'RO') pairs; the loop stops after a pair whose two movements are both below tol (never on the truncating pass; a NaN movement never stops it), or at max_passes (default 10) in all.

  • use_jit on the loops and on padded_start: a memoized jitted step inside the host loop (ragged) or the whole loop as one jax.jit program (uniform). newton_cg’s own use_jit governs the alignment too. With jax inputs pass use_jit=True: eager jax compiles every op of a new structure (about 22 s on the first step at d = 4) and adds thousands of process memory mappings per alignment.

  • Problem.local_model(..., frame=F) and backend.optimizers.padded_start(problem, x0, x_old, ...): a problem’s aligned frame without Newton, and a local model at it, for custom optimizers.

  • TuckerTensorTrain.oversampled_ranks(p, sharing=None) / UniformTuckerTensorTrain.oversampled_ranks(...) and backend.ranks.oversampled_ranks: +p on every rank, structurally minimal, never below the input.

  • Backend: the modules backend.padded_frames (fv_empty_frame, fv_padded_frame, tv_align_padded_frame, fv_aligned_padded_frame, the ALIGN_* defaults) and backend.uniform_padded_frames (ufv_empty_frame, ufv_padded_frame, utv_align_padded_frame, ufv_compact_frame, ufv_aligned_padded_frame); backend.linalg.pinned_completion, pinned_leading_columns and pad_safe_pinned_completion; backend.ufv_masking.ufv_frame_widths; the optional geometry members with_frame, require_frame_structure and aligned_padded_frame on the manifold geometries (the Geometry protocol documents them).

Changed#

  • No existing behaviour changes. The default Newton reference stays 'zero', fv_zero_point_frame is unchanged, and a newton_cg call without the new keywords returns bit-identical stats.

  • Tests: a dispatch row (numpy in, numpy out; jax in, jax out; under jax.jit where jittable) for every new public function, host loops included; tests/test_import_graph.py keeps the backend import graph acyclic; the heavy jax dispatch tests release their compiled programs (jax.clear_caches()), so parallel workers stay under the process memory-map limit.

  • CI: the py3.9 floor job is pinned to ubuntu-24.04 (ubuntu-latest moved to 26.04, where setup-python has no 3.9 build).

Removed#

  • None released. (A template-signature fv_operations.fv_padded_frame existed during development and never shipped.)

Known limitations#

  • The hint-free start is a function of the old frame’s representation, slot signs included: the ragged and uniform starts of one point differ, and a start can differ across BLAS builds. The aligned frame is representation-independent up to tol.

  • At a fixed point, every store’s completion spans the leading new directions of its own content, given the other stores’ completions, so one more pass moves nothing. The completions are then a stationary point of the captured hint energy ‖Π_{T(F)} hint‖² (proved for matrices, measured on T3s) but generally not a maximum of it: rotating one store’s completion alone never lowers that energy and generically raises it at second order. In measurements on small trees, they are a strict local maximum of the cone merit, one of many. The one reached depends on the start and the schedule. The cone merit is the share of the hint’s normal part that the new directions represent on one side of every edge; its best value does not depend on which side.

  • The uniform movement record is NaN after the last pass and cannot tell a NaN movement from an unrun pass.

[2026.3.0] — 2026-10-29#

The headline is the exact Riemannian Hessian for newton_cg (hessian='exact'): the Gauss-Newton term plus the manifold’s curvature, under a Steihaug–Toint trust region — the superlinear Newton tail on a nonzero-residual fit, for every sampling kind on every geometry and representation. It comes with a breaking-release groundwork: a zero-tensor default for the Newton reference, new stats keys, a public problem constructor, the GaussNewtonModel → LocalModel rename, clean uniform padding, and recurrence jet kernels. The mathematics – the lift, the two-hole sweep, the canonical zero-point frame, the trust region and their verification – is written up in the math note docs/exact_hessian_two_hole.pdf (source docs/exact_hessian_two_hole.tex). Upgrade notes: docs/release_notes.md, “Upgrading from 2026.2.0”.

Changed — breaking#

  • fitting.GaussNewtonModel is renamed fitting.LocalModel (also t3toolbox.LocalModel), mirroring the backend class it wraps, backend.optimizers.LocalModel. It is not aliased – the old name is gone, as UniformGaussNewtonModel went in 2026.2.0 – so a breaking release breaks loudly once rather than carrying two names. The six *_model factories keep their names, and the rename leaves the class’s methods and fields as they were (the exact mode adds to them, under Added).

  • The default Newton reference is the zero tensor of the level’s ranks, on the manifold geometries. newton_cg’s relative stop ‖g‖ ≤ gtol_rel·‖g₀‖ and its CG forcing term, and gradient_descent’s stop, used the warm-start ‖g(x0)‖ as ‖g₀‖. After a zero-padded continuation restart that gradient is deflated, so the stop was unreachable at the default gtol_rel and every level ran to its cap. Now g0_reference=None means the geometry’s own reference: on MANIFOLD / UNIFORM_MANIFOLD and their shared wrappers, the gradient norm at the zero tensor of x0’s ranks; on the corewise geometries (where the zero cores are a critical point) the warm start, as before. The reference is evaluated at a canonical zero-point frame (under Added), so it is a deterministic convention good to an O(1) factor, the same on the ragged and uniform layers, and nested across continuation levels. It moves every manifold stop by an O(1) factor relative to 2026.2.0, zero starts included (the old reference sat at the start’s LAPACK completion). Pass g0_reference='warm_start' to keep the old reference; the explicit g0norm_newton / g0norm_cg overrides still win. The downstream measurement behind the change (T3Polynomial, 30 Newton iterations per continuation level):

    level

    dof

    ‖g₀‖ at the zero tensor

    warm start / zero

    1

    417

    10.0

    1.03

    3

    1617

    14.4

    0.37

    5

    4609

    17.7

    0.21

    7

    10545

    22.2

    0.13

    9

    17917

    27.3

    0.053

    The zero reference also tightens the CG forcing term (~2× more CG work per step at high rank there, for the same accuracy). Continuation loops that carried stats['history'][0]['gnorm'] into g0norm_newton can drop that bookkeeping.

  • newton_cg’s stats['newton'] is replaced by stats['newton_steps'] (the same count: CG solves), stats['newton_accepted'] (steps taken: newton_steps minus the rejections – an Armijo-exhausted step under on_line_search_failure='stop', or a rejected trust-region trial) and stats['stop_reason'] ('gradient' / 'max_newton' / 'line_search', and with the trust region 'objective_floor' / 'trust_region_floor'). It is removed, not aliased: it overloaded “solves” and “steps”.

  • A non-positive g0norm_newton / g0norm_cg raises ValueError. 0.0 used to crash with a ZeroDivisionError in the forcing term.

  • The private optimizers._setup is removed, replaced by the public optimizers.least_squares_problem (under Added), which takes the same arguments (plus hessian, the mode the problem will be solved in) and returns a named LeastSquaresSetup rather than a 3-tuple. Not aliased.

  • optimizers.newton_cg no longer takes **kwargs. Its options are explicit keywords – max_newton, gtol_rel, cg_maxiter, c_armijo, on_line_search_failure, g0_reference, g0norm_newton, g0norm_cg and cg_forcing_power, beside the existing ones, and the exact-Hessian options hessian, curvature_damping, step_control and tr_radius0 (under Added) – with the backend’s defaults, so every option is in its signature and its docs. A misspelt option raises TypeError at the call, before the problem is built (it used to be forwarded, and the backend call rejected it after the setup work). Every valid call is unchanged. (gradient_descent / mc_sgd / adam still forward **kwargs.)

  • Uniform transposes return clean padding. Every uniform transpose wrapper that holds the frame’s or the point’s masks now re-masks its output, so the padded slots come back as exact zeros instead of the raw sweep’s garbage (the boundary-bond squash broadcasts the gradient into the padded boundary slots; measured up to ~3e12 on a moderate case). That covers the six uniform kinds’ transpose (backend.uniform_fitting.Uniform*Kind), the public utv_{probe,apply,entries}_transpose and utv_*_derivatives_transpose (and so UT3Tangent.*_transpose), and ut3_*_corewise_transpose / ut3_*_corewise_derivatives_transpose (and so UniformTuckerTensorTrain.*_corewise_*transpose). This is numerical hygiene, not a change of numerics: the real block is bit-identical (one multiply by a host mask, which under jit is a folded constant), so every result that honours the equivalence contract’s “padding is don’t-care” is unchanged, and a new consumer – the CG state included – no longer has to remember to mask on entry. It breaks only code that read the padding. The bare utv_*_transpose_from_sweep seam halves stay bare by contract; their callers, the kinds, re-mask.

  • Every production jet kernel is now a recurrence or an order scan; the binomial tensor is test-only (backend.sampling_derivatives; performance and memory, numerics equal to ~1e-15 relative – not bitwise, the summation order changed). 2026.1.0’s move off the dense trs[t,r,s] = C(t,r)·[r+s=t] contraction had stopped partway: the apply/entries-derivative forward and transpose, the probe transpose’s dx̃i combine and the TT gradient assembly (on every branch – the W-chunked form only wrapped the dense kernel) still contracted trs or a slice of it, and the order scans applied (order+1)² weight slices. Now an affine factor gives a banded two-term recurrence, and a full convolution is an order scan whose binomial weights come from a shift recurrence on a carried jet. Measured (CPU, float32 memory_analysis, per W-row, uniform, unchunked): the TT assembly 4-8× less scratch, dx̃i 13-15×, the exact Hessian’s two-hole TT assembly 5-14×; the jitted uniform probe-derivative transpose 4.3× and the two-hole 6.4× less temporary (d=4, r=16, order 3, W=2000). Time: the ragged-numpy GN probe-derivative transpose 2.3× faster there, the apply-derivative transpose 2×; small jitted uniform problems pay the sequential scans’ latency (~1.6× at d=5, r=8, W=300). Breaking, for backend callers of the jet kernels:

    • trs arguments are gone. compute_mu_jets / compute_nu_jets take order in its place (their input jets stop at order 1); compute_eta_jets, compute_{sigma,tau,deta}_jets, compute_{tau,sigma}_tilde_jets, compute_dxi_tilde_jets, compute_sigma_hat_jets, assemble_tt_variation_jets, compute_{tau,sigma}_tilde_tangent_jets, compute_dxi_tilde_tangent_jets and assemble_tt_tangent_variation_jets drop it (the order is read off their jets).

    • compute_dxi_tilde_jets / compute_dxi_tilde_tangent_jets return only the two rows that are read: (2,)+W+K+C+(nOi,) (rows u = 0, 1; row 1 is zero at order 0), not (order+1,)+...; assemble_tucker_variation_jets / assemble_tucker_tangent_variation_jets take that two-row jet.

    • Removed (not aliased): binomial_combine_tensor and the dense *_trs twins (compute_{mu,nu,eta}_jets_trs, compute_{sigma,tau,deta}_jets_trs, compute_{tau,sigma}_tilde_jets_trs, assemble_tt_variation_jets_trs) – they are the test suite’s reference forms now (tests/_jet_trs_twins.py); assemble_tucker_variation_jets_trs (which contracted no trs) is removed too – it lives on privately as _assemble_tucker_variation_jets_dense; pass chunk_size=None to assemble_tucker_variation_jets for the unchunked assembly.

    • estimate_chunk_size / max_chunk_size_within measure the running program: the per-row cost is now the slope in chunk_size of the compiled chunked transpose (and, for hessian='exact', of the two-hole) – the assemblies plus the chunk’s slices of their input jets – where it was one dense kernel lowered alone. The answers grow with the smaller cost: rank 128, order 5, a 16 MiB budget gives 195 (was 2); the balanced policy now admits the whole W in the usual case (the assemblies cost less per row than the resident jets), so chunk_size='auto' fits chunk less or not at all. The measured cost is the jax release’s own (figures above: current jax): jaxlib 0.4.30 packs the chunk loop into memory the earlier stages free, about one jet slice per row (~5-15× less), so its budget chunks are that much larger.

Changed#

  • SamplingKind has a sixth operation, corewise_hessian, needed only for the exact Hessian (hessian='exact'): the derivative of transpose along raw core directions. A kind written against the five-operation recipe keeps working with the default Gauss-Newton model; Problem.local_model(..., hessian='exact') (and so newton_cg and the *_model factories in exact mode) rejects it up front with a structural ValueError naming the missing operation (the base method carries the stdlib abc.abstractmethod marker, which the check reads; the class is not an ABC, so instantiation is unaffected). Every built-in kind and its Uniform* twin implements it. Likewise a custom geometry needs the four exact-mode members (under Added) only for hessian='exact', and zero_point_frame is optional.

  • NewtonInfo.cg_truncated excludes trust-region boundary stops: it is now (not cg_converged) and (not cg_ok) and (not cg_boundary) – a Steihaug stop on nonpositive curvature is a boundary step, not a truncation – and cg_converged is False on a boundary stop, so a row’s CG outcome is exactly one of converged / boundary / truncated / the cap. With the default line search there is no boundary, so both are unchanged there.

  • Display only, numerics unchanged: the verbose=True / make_newton_display converged line names its reference – converged (‖g‖ ≤ gtol·‖g₀‖, g₀ = zero tensor) / warm start / override (a hand-built NewtonInfo row with no reference kind prints exactly as before) – and a run’s last row names its stop when that is not the gradient test (| stop: max_newton, line_search, objective_floor, trust_region_floor). The Gauss-Newton line-search rows are otherwise byte-identical.

  • The backend’s private CG _cg_solve returns a 5-tuple (p, iters, resid², ok, boundary) and takes a trailing radius (default inf: the plain CG, bit for bit). Internal, listed for scripts that called it.

  • Bit-identical refactors the exact Hessian reuses: backend.sharing.fv_shared_frame_data takes its centers from the new fv_operations.fv_center_factors; backend.tv_operations.tv_project_t3_onto_tangent_space gauges the shared T3-to-T3 kernel t3_linalg.t3_inner_product_corewise_transpose; the shared manifold’s tied projection and retraction share the filtered solve with the tied lift; the ragged t3_precompute_inner_product_sweep / t3_inner_product_corewise_hessian_from_sweep are polymorphic over supercores (d-prefixed contractions).

Fixed#

  • The safe-mode gauge check no longer rejects a near-cancelling difference of gauged tangents. MANIFOLD.norm / inner (and the uniform twins) measured a - b against its own norm, so the finite-difference check of a Hessian, MANIFOLD.norm(H_fd - hessian(p)) with the two agreeing to 1e-8, raised on each operand’s 1e-16 roundoff gauge violation. A tangent built by + / - / scalar * / stack_tangents is now measured against its operands’ scale (max(‖a‖, ‖b‖), |c|·‖a‖, per stack element, recursively) as a floor under its own norm, so the check is never stricter than before; a tangent computed directly (a projection, a gradient) keeps the self-relative check, and one ungauged in its own right still fails when checked itself. The scale is recorded only in safe mode, eagerly, and is not jax pytree state, so a jit round-trip measures self-relative again. Its limit, documented: dividing a finite-difference quotient by its step divides the recorded scale too, so to certify a computed tangent’s gauge, check that tangent itself. Backend: tv_gauge_residual / utv_gauge_residual take scale= (default None: unchanged, bitwise). docs/numerical_contracts.md.

  • Jet outputs keep their inputs’ dtype. Each jet kernel (the *_derivatives forwards, transposes and the two-hole) now preserves float32, under jax_enable_x64 and on numpy alike. Their scan inits (the order-0 ones, the zero boundary jets, the adjoint zeros, the inner-scan accumulators, the entries one-hots) were built in the default dtype and promoted every float32 jet to float64 – 2026.2.0 did the same. A float32 fit can still come back float64 (every manifold fit does): the frame build (t3_orthogonal_representations), the plain probe / apply / entries ops and a few uniform paddings still build default-dtype arrays upstream of the kernels (recorded in the deferred ledger for a follow-up).

  • Uniform tangent stacks reach the local model. A uniform kind’s forward (hence a Gauss-Newton or exact hvp), the uniform geometries’ project and inner, and the uniform fitting.LocalModel’s actions took a K-stacked trial tangent’s coordinates (a stack of tangents at one frame) with the frame’s C-stacked masks and failed in a reshape; the masks are now broadcast over K, as the ragged layer and the uniform transposes already did. The uniform geometries’ inner keeps the whole K + C stack per element, as the ragged twin (it kept only |C| leading axes – K’s, on a stacked pair – unreachable until now).

  • A uniform fitting.LocalModel keeps its static structure out of the traced leaves. Its jax flatten traced the frame sweep’s mode sizes (Python ints) as leaves, so under jit they became tracers; it now partitions them into the treedef like the backend LocalModel (backend.common.partition_static).

  • The uniform tied projection’s padding is exactly zero. backend.sharing.ufv_share_tucker_variations (the shared uniform manifold’s project) left roundoff (~1e-16 relative) in the padded rows of the group modes’ Tucker variations – the companion SVD’s U_M is not exactly zero there – so its output was not masked-clean as documented; it is now re-masked. The real blocks, and every fit, are unchanged bit for bit.

  • estimate_chunk_size / max_chunk_size_within no longer warn on a float64 dtype with x64 off. jax truncated the requested float64 to float32 with a UserWarning on every lowering (so chunk_size='auto' warned for every numpy-float64 uniform fit); the measurement now requests the canonical dtype itself – the same float32 program, the same answer, silently.

Added#

  • The exact Riemannian Hessian – hessian='gauss_newton' | 'exact' (case-insensitive; Gauss-Newton stays the default) on newton_cg (frontend and backend), the six fitting.*_model factories and the backend Problem.local_model(x, sample, data, hessian, curvature_damping). An exact model’s Hessian action is Π[𝒥ᵀω²𝒥Πp + Lᵀ(K_{Aᵀω²r} − K_{grad f})LΠp] (+ H_R p) – the Gauss-Newton term plus the Weingarten curvature (Absil, Mahony & Trumpf 2013), through the lift L from gauged coordinates to raw core directions, the kind’s corewise_hessian at the weighted residual and the inner product’s two-hole at the misfit gradient – equal to the second derivative of the objective along the T3-SVD retraction (second order on a minimal, numerically full-rank frame); on a corewise geometry it is the plain Hessian of f ∘ Φ in the cores. It runs for every sampling kind (apply, entries, probe and their *_derivatives), on every geometry and representation – MANIFOLD / COREWISE, UNIFORM_MANIFOLD / UNIFORM_COREWISE and the shared(...) wrappers of all four – use_jit included; per stack element the uniform exact model is the ragged one. It gives the superlinear Newton tail where Gauss-Newton is linear on a nonzero-residual fit (q-quadratic with cg_forcing_power=1.0; the default stays 0.5 in both modes), at about 3-4× the cost of a Gauss-Newton Hessian-apply (measured 2.8-3.9× on numpy CPU across the six kinds; the two-hole’s memory peak is ~2× the Gauss-Newton transpose’s). Per Newton step the model does one misfit transpose, shared by the gradient (an exact model’s gradient is the Gauss-Newton one, bit for bit) and the curvature term. curvature_damping (default None = backend.geometry.DEFAULT_CURVATURE_DAMPING = 1e-6, relative to ‖X‖_HS) damps the lift’s pseudo-inverses; it raises with the Gauss-Newton model and on a corewise geometry, where nothing would read it. Where the representable set is flat (a slot at maximal rank; every slot at d = 1) the curvature term vanishes by itself, and the manifold d = 1 model skips it. At a zero-padded continuation restart the clipped lift drops the new zero-singular-value directions from the curvature (no special case); on the shared manifold the lift is tied – each sharing group’s coordinates lift to ONE raw factor direction, U̇_g = M_g^{+ε}[V_i₁; …], against the same stacked-S SVD the tied projection uses, its transpose summing the group’s copies – the normal part is taken against the shared misfit gradient, a padded restart’s zero s_g levels filter to exactly 0, and the shared retraction is second order as measured (O(h²)), not proven. On the uniform layer every padded slot of a direction is masked (with the masks of the FRAME, a strict subset of the point’s at TT slack) before the second derivative sees it – the masks are load-bearing there, not hygiene – and every output is re-masked; from a numerically full-rank start a uniform exact run is the ragged run (counts and objective row by row), from a zero-padded restart the two layers’ frames legitimately differ and each converges on its own. docs/fitting_and_optimization.md §4.12.

  • Trust-region step control in newton_cg (both layers): step_control='line_search' | 'trust_region' (None: the line search with Gauss-Newton, unchanged bit for bit; the trust region with the exact Hessian; either combines with either) and tr_radius0. Steihaug-Toint CG inside ‖p‖ ≤ Δ – it steps to the boundary on nonpositive curvature or when it would leave the region – then one trial retract(p), accepted iff ρ = Δf / (gᵀp + ½pᵀHp) > 0.1; Δ ← ¼‖p‖ when ρ < 0.25, Δ ← min(2Δ, 10⁴Δ0) when ρ > 0.75 on a boundary step; Δ0 = tr_radius0, by default the Gauss-Newton Cauchy length ‖g‖³/⟨g, H_GN g⟩ (tr_radius0 with the line search raises, as does on_line_search_failure='accept' with the trust region). A rejected trial keeps x and its local model and counts toward max_newton. Two new stop_reason values, checked only after a rejection: 'objective_floor' – the predicted change is below the objective’s floating-point resolution, |pred| ≤ 10·ε·(‖ω⊙y‖·‖ω⊙r‖ + |f|) with ε the residual dtype’s machine epsilon: the attainable accuracy is reached, not a failure – and 'trust_region_floor' (Δ < 10⁻¹²·Δ0). A trust-region NewtonInfo row has ls_steps = ls_failed = None and alpha = 1.0 (filter history rows on step_control).

  • NewtonInfo fields, all defaulting to None (so a hand-built row needs none) and carried in stats['history']: g0_reference (the Newton-stop reference: 'zero' / 'warm_start' / 'override'), cg_reference (the CG-forcing one), step_control, hessian, stop_reason (on the last row), and the trust-region / exact ones tr_radius, tr_accepted, cg_boundary, pKp (the curvature term’s part of pHp), lift_sigma_min (the smallest lift singular value; a shared group’s s_g in place of its modes’ own), lift_eps (the absolute lift damping). The display’s step segment reads TR Δ … ✓/✗ on a trust-region row, CG’s symbol ∂ on a boundary stop, and an exact row appends κ σ ε (κ = pKp/(pHp − pKp)).

  • The frontend exact model: fitting.LocalModel gains the curvature field (the backend CurvatureState, a jax leaf: a rebuilt model or a new damping does not recompile) and the derived read-only is_exact; new methods, in both modes, hessian(p) / quadratic(p) (the mode’s Hessian action and form – gn_hessian / gn_quadratic on a Gauss-Newton model, plus the curvature term on an exact one) and retract(p) (geometry.retract(p) at the model’s frame, with the shared manifold’s stored companion – the twin of backend.optimizers.LocalModel.retract); on an exact model only (a Gauss-Newton one raises), curvature_hessian(p) / curvature_quadratic(p), the curvature term alone. evaluate(p) is mode-aware (the Gauss-Newton value is unchanged). The frontend run is the backend run, bit for bit; the exact hessian(p) sums its two gauged halves and so equals the backend hvp to rounding.

  • The exact mode’s backend surface. backend.optimizers.LocalModel gains curvature, is_exact, curvature_hvp, quadratic and curvature_quadratic (gradient, gn_quadratic, jacobian and retract are unchanged); backend.optimizers.CurvatureState (the model’s one misfit gradient and the geometry’s per-frame curvature data, pytree leaves). The geometries gain four exact-mode members – curvature_precompute, lift, lift_transpose, tangential_curvature – with backend.geometry.ManifoldCurvatureData (diagnostics sigma_min / eps) and DEFAULT_CURVATURE_DAMPING; the kinds gain corewise_hessian (under Changed). The building blocks, each a standalone backend function (ragged ones polymorphic over uniform supercores; uniform ut3_ / utv_ / ufv_ twins mask their inputs with the point’s or frame’s masks and re-mask their outputs):

    • the lift – backend.linalg.filtered_reciprocal / damped_pseudo_inverse (the clipped, optionally Tikhonov-damped reciprocal of a spectrum, and the pseudo-inverse built on it); backend.fv_operations.fv_center_factors (a frame’s centers H_i, Tucker factors S_iᵀ and bond factors T_i, recomputed by zipper), LiftFactors and fv_lift_factors(frame, curvature_damping); backend.sharing.fv_tied_lift_factors (a shared point’s tied lift factors; LiftFactors gains shared_data / tied_filters); backend.tv_operations.tv_corewise_lift / tv_corewise_lift_transpose, exact at zero damping on every numerically full-rank orthogonal frame, minimal or not; the uniform ufv_operations.ufv_lift_factors / ufv_tied_lift_factors and utv_operations.utv_corewise_lift[_transpose] (each block clipped at its REAL dimensions; padded singular values exactly 0);

    • the T3-to-T3 term – backend.t3_linalg.t3_inner_product_corewise_transpose (the gradient of θ ↦ ⟨z, Φ(θ)⟩), t3_precompute_inner_product_sweep and t3_inner_product_corewise_hessian[_from_sweep] (its Hessian on a stack of directions, by a two-hole sweep), the tangent zippers backend.tt_operations.tt_zipper_tangent_left_to_right / _right_to_left, and the uniform ut3_linalg.ut3_inner_product_corewise_transpose / ut3_precompute_inner_product_sweep / ut3_inner_product_corewise_hessian[_from_sweep];

    • the sampling terms – per kind, the derivative of its corewise transpose along raw core directions by a hand-written two-hole sweep (exact, symmetric; the weight enters as ω²r, as in the gradient): backend.sampling_derivatives.t3_probe_corewise_derivatives_hessian[_from_sweep] (its assemblies W-chunked by chunk_size like the transpose’s) with its public pieces compute_deta_tilde_tangent_jets, compute_tau_tilde_tangent_jets / compute_sigma_tilde_tangent_jets (the dotted adjoint sweeps), compute_dxi_tilde_tangent_jets, assemble_tucker_tangent_variation_jets and assemble_tt_tangent_variation_jets (factored by the product rule); backend.probing.t3_probe_corewise_hessian[_from_sweep] (with compute_deta_tilde_tangent, compute_tau_tilde_tangent / compute_sigma_tilde_tangent, compute_dxi_tilde_tangent, assemble_tucker_tangent_variations, assemble_tt_tangent_variations); backend.apply.t3_apply_corewise_hessian[_from_sweep] and backend.entries.t3_entries_corewise_hessian[_from_sweep] (the residual-seeded right context swept through the cores); sampling_derivatives.t3_apply_corewise_derivatives_hessian[_from_sweep] / t3_entries_corewise_derivatives_hessian[_from_sweep] (with compute_sigma_hat_tangent_jets, beside compute_sigma_hat_jets); and their uniform twins backend.ut3_sampling.ut3_{probe,apply,entries}_corewise_hessian[_from_sweep], ut3_probe_corewise_derivatives_hessian[_from_sweep] and ut3_{apply,entries}_corewise_derivatives_hessian[_from_sweep];

    • chunk sizing – estimate_chunk_size / max_chunk_size_within take hessian='gauss_newton' (the default, the transpose-only answer) or 'exact' (anything else raises ValueError); 'exact' sizes the chunk so that the two-hole, whose chunk costs ~1.3-2.2× the transpose’s per row, also fits. chunk_size='auto' resolves to None for the five kinds other than probe_derivatives in both modes, as their transposes do not chunk.

  • g0_reference on newton_cg and gradient_descent (frontend and backend): None (the geometry’s own), 'zero' or 'warm_start', case-insensitive. An explicit 'zero' on a geometry with no zero-point frame (a corewise one) is a ValueError; a vanishing zero reference (e.g. all-zero data) falls back to the warm start with a RuntimeWarning by default and raises when 'zero' was asked for explicitly.

  • The canonical zero-point frame: backend.fv_operations.fv_zero_point_frame(frame, groups, seed) and its uniform twin backend.ufv_operations.ufv_zero_point_frame, with the fixed seed fv_operations.ZERO_FRAME_SEED = 0. Seeded Haar Tucker factors (one per sharing group, from a stream keyed by the group’s first mode) and identity-prefix TT cores: rank-independent, nested, and the same real blocks on both layers. A Haar completion because a coordinate-aligned one gives a reference of exactly 0 on data with no energy on its leading coordinates.

  • Geometry.zero_point_frame(frame), an optional, duck-typed member: the four backend geometries define it (None on the corewise ones). A custom geometry without it keeps working, with the warm-start reference as its default.

  • optimizers.least_squares_problem(geometry, kind, sample, data, x0, order, weight, regularizer, chunk_size, batch, hessian), the frontend twin of backend.optimizers.least_squares_problem: it builds the backend Problem from the frontend vocabulary (a geometry singleton or SharedGeometry, a kind name, order / weight, a ragged or uniform x0) – the constructor the four optimizers use, now public for scripts that build local models or drive a backend optimizer directly. hessian ('gauss_newton' default, or 'exact') is the mode the problem will be solved in: it does not fix the mode, it sizes chunk_size='auto' for the exact Hessian’s two-hole too (newton_cg passes its own). It returns optimizers.LeastSquaresSetup, a frozen dataclass with .problem, .x0_cores (the backend starting cores, reduced to minimal ranks where the optimizers reduce them) and .rewrap (backend cores -> the frontend tensor). Module-level only, not re-exported at the root.

  • backend.geometry.UniformManifoldGeometryOps.from_frame(frame_data, plain_masks, sharing): the uniform manifold geometry from a frame already in hand – its variation masks are the frame’s own, gauge-shifted – the same geometry as from_point without re-orthogonalizing. The uniform fitting.LocalModel builds its backend geometry this way (one orthogonalization fewer per regularized or exact model).

[2026.2.0] — 2026-08-25#

Changed — breaking#

  • The optimization layer’s axis objects are classes, not records of closures. A geometry and a sampling kind are now frozen dataclasses whose parameters are fields; their behaviour is methods. This is what makes them compare and hash by value, which matters because both ride as jax aux_data and therefore form part of the compilation cache key. Rationale, measurements and the rejected alternatives: contributor/parameters_not_closures.md.

    • New backend/geometry.py with ManifoldGeometryOps / CorewiseGeometryOps and their Uniform* twins (the uniform ones carry the fixed rank they were built at; use from_point). Removed: backend.optimizers.GeometryOps, MANIFOLD_OPS, COREWISE_OPS, shared_geometry_ops, and backend.uniform_fitting.uniform_{manifold,corewise,geometry}_ops.

    • Sharing is a groups field, not a wrapper — one class and one code path for shared and unshared. The frontend shared_manifold / shared_corewise constructors are unchanged.

    • SamplingKind is a class hierarchy (ApplyKind, EntriesKind, ProbeKind, the three *DerivativesKind, and their Uniform* twins). The *_kind constructor spellings still work. Removed: the identity field and its __eq__/__hash__, and the six uniform builder functions uniform_{apply,entries,probe}_kind / uniform_{apply,entries,probe}_derivatives_kind (use Uniform*Kind.from_point(x0_data, **parameters), or the unchanged uniform_sampling_kind / uniform_derivatives_kind dispatchers). A custom kind is now a subclass; deriving one with dataclasses.replace no longer type-checks, and that is the point — see below. ScalarOutputKind and ProbeOutputKind are public, so a new operator can inherit the ‖·‖² reductions.

    • fitting.UniformGaussNewtonModel is removed. One GaussNewtonModel serves both representations; the factories still dispatch on x. It is deliberately not aliased.

    • optimizer_display gates its error table on kind.has_block_sumsq rather than on a block_sumsq field being None. block_sumsq is optional; the flag is declared by whoever implements it.

    • A custom backend geometry needs three more members: stack_shape(x_cores), base_point(frame), and a precompute that is a callable returning None rather than None itself. The Geometry protocol in backend/optimizers.py lists the full surface.

  • Optimizing a STACKED point raises NotImplementedError. It never worked – newton_cg and gradient_descent failed on float() of a shape-C objective, mc_sgd on a broadcast, and adam once its loss logging first fired – but it failed obscurely, from deep inside the loop. Building the local model on a stacked point is supported and still works, so rolling your own loop over a stacked problem is the route. Stacked optimization is possible future work.

Fixed#

The items below came out of the 2026-08-22 whole-library review (dev/review_2026-08-22/).

  • The safe-mode trace detector is the committed-array probe alone (review H6-12). The old primary detector, jax.core.trace_state_clean, does not exist in jax 0.10 – every check on jax inputs paid a raise/catch before falling back – and its docstring promised any-transform detection the probe never delivered. Behavior under jit is unchanged (checks skip); under grad/vmap with concrete operands the checks run, as they always effectively did – harmless and now documented. The batching docs also record why a stacked UniformTuckerTensorTrain cannot be vmap-ed at all (masks are static aux; use the native C stack).

  • The uniform same-frame guard compares real (masked) content only (review H5-5). Two frames identical up to the don’t-care padding now count as the SAME frame – the tangent space depends only on the real content – so UT3Tangent arithmetic / stack_tangents between a frame and a re-padded copy of it works instead of raising “different tangent spaces”. safety.frames_equal itself stays representation-agnostic; its contract is now explicit: callers pass real content, and the uniform call sites mask their supercores first. (This also makes UT3Frame’s documented “frames_equal on the masked supercores” true.)

  • The review’s oracle sweeps are permanent tests (Phase D): tests/test_oracle_sweep.py runs the O1 sampling/tangent sweep (dense einsum + exact combinatorial jet oracles + adjoint identities, ragged and uniform incl. varying-rank stacks) and the O2 fitting sweep (polynomial-interpolation oracle vs GaussNewtonModel; optimizer trajectories vs hand recomputation, ragged == uniform) from verbatim copies of the review scripts in tests/oracle_sweeps/. Two tiers: always-on (full O1 + full O2 models + a pairwise-covering optimizer subset) and T3TOOLBOX_SLOW_TESTS=1 for the full optimizer matrix – a required release-gate step, so nothing the review matrix covered stops being enforced.

  • Small ergonomics from the review’s E list (R9-10, R7-11, R3-7): chunk_size now threads through both frontends’ probe_corewise_derivatives_transpose (and the uniform backend wrapper) – it existed only on the ragged backend and the tangent-level transposes; chunk_size='auto' resolution reads supercore shapes without pulling the arrays to host, and the fallback chunk size is the single backend.sampling_derivatives.DEFAULT_CHUNK_SIZE constant; the minimal-rank recurrence in backend.ranks uses the dispatched backend throughout (three stray np.minimum calls made it jit-hostile).

  • jit cache-key hygiene on the value-hashed aux family (reviews H1-5, H1-6, R2-7, H2-8, R7-13). The mask holders’ hash and == now derive from one content key (they could disagree on dtype and silently zip-truncate on length); a jax-array field in a ValueHashedFields aux raises a directive TypeError (device arrays belong in leaves); the aux objects (mask holders, uniform geometries and kinds) store defensive read-only copies of their mask arrays, so mutating a caller’s mask in place can no longer stale a cached cache key – in-place writes to stored masks now raise; shared(...) geometries key their identity (and jit aux) on the canonical partition, so label spellings of the same partition share one compiled program, and a SharedGeometry subclass now survives the jit round-trip as itself. The stack(unstack(x))-under-jit findings were verified already fixed by the review’s static-axes moveaxis and are pinned by a regression test.

  • Obscure errors on malformed inputs became structural guards (the review’s E-cluster sweep, 2026-08-24: R2-8, R2-12, R2-13, R3-6, H3-7, R8-6, R8-9, R1-15, R10-6, H3-8, R9-9). Str leaves no longer recurse the tree helpers forever; tree_zip rejects structure mismatches instead of silently truncating; truncated_svd(min_rank > max_rank) raises (min used to silently win); t3_inner_product takes list/tuple mixes and t3_sum_stack an ndarray axis; uniform * is scalar-only with a clear TypeError, uniform stack validates the static layout, and uniform minimal_ranks stays host numpy on jax-backed trains; the ragged tensor-weight ops check rank/stack consistency (one-metric broadcast still allowed); COREWISE.retract rejects a detectable manifold-frame tangent; SharedGeometry names a wrong-layer point/frame. One regression test per finding.

  • The uniform frame at a numerically rank-deficient point loses no tangent directions (review S1b – the last open review item). Every kept-basis SVD in the uniform orthogonalization and T3-SVD sweeps now goes through the new mask-aware backend.linalg.pad_safe_svd, so the sigma ~= 0 completion columns stay OFF the padding instead of landing in padded slots that the masks then erase. Before the fix, a zero-padded resize warm start – the rank-continuation restart – produced a uniform frame whose masked real block was genuinely rank-deficient (60/60 trials), silently losing exactly the tangent directions continuation needs to grow into. Affects UT3Frame.from_ut3 / ut3_orthogonal_representations, the per-core ut3_*_orthogonalize_* ops, and ut3svd / ut3_rank_adjustment_sweep / ut3svd_orthogonal_representations (unshared and SF-T3 shared). Regression tests: TestPadSafeFrame in tests/test_uniform_frame_variations_format.py.

  • Uniform +, -, squash_tails and sum_stack read padding garbage. ut3_squash_tails summed the leading/trailing TT bond over every slot, including the padded ones the equivalence contract declares don’t-care – and a corewise gradient step (adam(UNIFORM_COREWISE, …), UNIFORM_COREWISE.retract) leaves exactly those slots nonzero, so x_fit + y was silently wrong while to_dense/norm (which mask on entry) were right. It now masks on entry.

  • t3m with boundary TT ranks r0, rd != 1. inplace_fused (the default) never SVD’d the last bond, so an unsquashed trailing bond survived as rd_x · rd_y and escaped max_tt_ranks; swap contracted the two operands’ trailing bonds against each other (silently wrong when equal, a raw einsum error when not) and ignored a per-position max_tt_ranks given as a numpy array. Every t3m method now canonicalizes both operands’ boundary bonds to 1 on entry – the rule, and why the exact */t3_mult deliberately do not, is in t3m_methods.md.

  • entries_ambient_transpose returned zero factors for a negative index. Its one-hots were built with arange(N) == index, which matches nothing for -1; the forward entries and the tangent/corewise transposes wrap numpy-style, so the adjoint identity silently failed. All four now agree (eye(N)[index]). Documented alongside: an out-of-range index raises under numpy but clamps under jax (gather semantics).

  • The documented singular-value-metric recipe applied the σ’s in the wrong gauge. docs/weighting.md paired T3FrameWeights.from_t3weights(T3Weights.from_t3svd(x)) with a frame from t3_orthogonal_representations(x), which re-SVDs the already-orthonormal Tucker factors of a T3-SVD result – a degenerate spectrum, so the frame’s Tucker basis comes back rotated by an arbitrary orthogonal matrix relative to the singular basis, and per-coordinate σ-weights then weight the wrong directions (unstacked too; the planning measurement said “stacked only”). New t3svd_orthogonal_representations(x, **t3svd_kwargs) (+ the ut3svd_ twin, both exported at the root) returns (frame, variations, T3Weights) from ONE SVD with the frame built already_left_orthogonal=True, so its Tucker basis is the singular basis; the recipe and the from_t3svd docstring now say so.

  • The shared-factor companion was wrong on a frame converted between layers. fv_shared_frame_data recomputed the centers by re-running the SVD sweep that built the frame, which reproduces the construction’s sign choices only when it is the same SVD on the same arrays; on a UT3Frame.to_t3frame() leaf – the route UniformManifoldGeometry.project_ambient recommends for dense gradients – the tied projection was silently 30% off (the group spectrum, being gauge-invariant, looked right). The centers are now the zipper of the stored chains (H_i = L_i Z_{i+1}, no SVD), exact and gauge-consistent for a frame built by either layer; the uniform twin masks first, and the “frames packed from ragged are not guaranteed” caveat is gone.

  • jax.grad through uniform norm() / inner() / ut3_weighted_norm / ut3_weighted_inner was all-NaN on any train with rank slack – the default orthogonalized path differentiated through the SVD, whose JVP has 1/(σᵢ²−σⱼ²) terms and a padded train has several exactly-zero σ’s. New backend twins ut3_norm / ut3_inner (closing a ledger item) keep the precise orthogonalized VALUE and carry a custom_jvp with the exact multilinear derivative (2⟨T, dT⟩, via the zipper with the orthogonalized side held fixed – no SVD in the derivative path); the frontend and the weighted ops route through them.

  • backend.optimizers.Problem.objective(x, data=…) / .local_model(x, data=…) ignored data when sample was omitted, silently scoring the training data; sample= alone crashed with a bare TypeError. The pair now goes together or not at all (a structural error otherwise).

  • The regularized objective was wrong at a raw point on the ragged manifold. ManifoldGeometryOps.point_norm_sq read ‖last TT core‖², exact only for a left-orthogonal point (measured 3 where the truth was 1400 on a randn point). Backend-only: the optimizers evaluate the regularizer through the frame or at retraction outputs, so no optimizer result or stats row was affected. It now left-orthogonalizes first (no W factor, negligible beside the misfit it sits next to), matching the uniform twin.

  • UT3Variations.sum_stack(axis=-1) / UT3Tangent.sum_tangents(axis=-1) summed over the MODE axis (the raw 1 + axis sent -1 to array axis 0), silently when K == d and with an obscure shape error otherwise. Negative axes now count from the last stack axis, as in numpy and the ragged twin; out of range raises.

  • A structural tangent mismatch was caught only by the numerical same-frame guard, which is skipped under safety.unsafe() / a jax trace – so a + b for tangents at frames of different rank structure broadcast silently there. The core-shape comparison now runs unconditionally (structural problems always error), in T3Tangent and the fitting model’s trial-tangent guard.

  • 30 structural checks were written as assert (x * ndarray shape, stack-axis ranges, core-tuple lengths, corewise operand types, dense_probe vector shapes, …): a bare AssertionError normally, and no check at all under python -O, where a wrong-shaped x * ndarray broadcast silently. All are ValueError / TypeError with a message now.

  • The gauge precondition compared an absolute residual against the relative tolerance. gauge_residual was max|UᵀV|, which scales with the tangent, while MANIFOLD.inner/norm threshold it at rtol (1e-9 numpy, 1e-5 jax): a correctly gauged tangent of norm ≳1e8 failed in numpy, and on jax’s default float32 one of norm ≳50 – the documented jax-eager safe-mode use – while a tiny ungauged tangent passed. The residual is now relative (each gram divided by its variation core’s norm, per stack element), on both layers.

  • The tangent/corewise apply/entries transposes rejected a bare Python float residual (the natural unstacked case; the ambient twin’s own doctest passes 1.7).

  • d = 1 on the ragged manifold: MANIFOLD.project_ambient(frame, <T3>), project_ambient(…, method='t3svd') and MANIFOLD.transport raised an IndexError (an empty TT chain has no zipper); dense_probe raised on a one-mode tensor with a probe stack. A one-mode T3 is a vector; these now degenerate to that case like everything else.

  • UNIFORM_MANIFOLD.transport / project_ambient crashed on a K-stacked tangent or gradient (the frame’s C-stack gauge masks were handed to K+C variations and failed in a reshape); the ragged twins accepted K. The masks are now broadcast over K (new ufv_masking.ufv_variation_masks_over_stack, the same rule the sampling transposes already used).

  • stack() was not jittable (TuckerTensorTrain.stack, T3Frame.stack, T3Tangent.stack_tangents, the uniform twins): moveaxis was given an arange source, which is a tracer under jit.

  • adam on a ragged manifold with a non-minimal-rank x0 crashed at step 2 (its moment trees were allocated at x0’s core shapes; the first retraction drops the redundant rank). A ragged manifold x0 is now reduced to minimal ranks on entry, mirroring the uniform path’s uniform_minimal; a minimal start is untouched.

  • A slack-padded x0 crashed every uniform manifold optimizer at step 2. UniformTuckerTensorTrain.from_t3(x, n=, r=) (the documented “force a larger pad”) passes the minimal-rank gate, but utv_retract returned its point at the max rank ut3svd kept rather than at the frame’s padded dims (its docstring promised the latter), so the loop-invariant masks no longer fit. The retraction now re-pads (new backend.ut3_operations.ut3_pad_ranks).

  • newton_cg(verbose=True, val_data=…) without val_sample failed deep inside the kind, and val_sample alone was silently ignored; both now raise at the entry (make_newton_display too).

  • uniform_least_squares_problem accepted any non-'manifold' geometry string as corewise (so 'Manifold' silently fit on the wrong geometry), and built a Problem for a derivative kind without order= that failed on first use. Geometry and kind strings are validated (case-insensitively, see below) and order is required up front.

  • Structural validation gaps and wrong messages (each a deep or misleading failure before): check_fv_pair accepted a frame and variations with different numbers of cores (four ops then returned partial sums); T3Frame.validate’s Tucker-rank message printed stack dimensions on a stacked frame; entries() with a wrong-length list index raised AttributeError instead of the documented ValueError; share(rtol=…) on a stacked T3 failed inside truncated_svd; uniform + / inner on operands with different padded widths N raised raw numpy errors; the six GaussNewtonModel factories did no validation of the sample / residual against the point; set_default_safety(None, None) was accepted and then every check crashed (it now means unsafe by default, the one script-level way to get it; a lone None is rejected); has_numerically_minimal_ranks() raised on a stacked train (now a per-element bool array like the other checkers).

Changed#

  • == and hash are now explicit-only on every runtime array-carrying class (review R1-13 extended; ruled 2026-08-24). TuckerTensorTrain, T3Weights, T3Frame, T3Variations, T3FrameWeights, T3Tangent and their six uniform twins refuse == with a TypeError naming the named checks (x == x stays True via the identity fast path) and are unhashable – the equality of a floating-point tensor representation is not a well-posed operator question, so the user says which equality they mean: a.allclose(b[, rtol=, atol=]) for what the objects REPRESENT (numerical, per stack element; gauge/padding-invariant for trains; the BASE POINT for frames, with safety.frames_equal answering the same-FRAME question), a.corewise_equal(b) for the bitwise representation, a is b for identity. Previously == raised numpy’s ambiguous-truth error (T3Frame: silently compared identity – a vestige of the pre-safety-redesign aux_data era, per its own history). Value-based hash/eq remains exactly where jit needs it: the aux_data family (mask holders, geometries, kinds). Rule + rationale: backend.common.ExplicitEquality. The pre-existing allclose methods (T3Tangent / UT3Tangent / UT3Frame) are unified into the family: default rtol is now the ambient safety default (same value on numpy float64), the reference is the symmetric max(||a||, ||b||) (was ||other||), and the tangent twins now CHECK the same-frame precondition they used to assume.

  • Citing T3Toolbox means citing the software, not the T4S paper. CITATION.cff’s preferred-citation used to redirect citations to the research preprint the library grew out of; the library is a general-purpose T3 toolkit and is cited as software. The paper moved to the CFF references list (cite it when building on its research contributions); README / docs wording aligned.

  • The six utv_*_transpose_from_sweep hooks now default sum_over_probes=False, matching their ragged twins (review H2-4). Each says it “shares” the ragged function, but the uniform defaults summed the probe stack W while ragged kept it – so a raw-.data user porting ragged split-seam code to uniform silently got a different result shape. No shipped path changes (both frontends already defaulted False; the fitting kinds pass True explicitly). Breaking only for raw-backend callers that relied on the old uniform default: pass sum_over_probes=True explicitly.

  • A failed Armijo line search stops newton_cg / gradient_descent instead of silently accepting an ascent (review R7-7). Exhausting every halving (40 / 50) used to accept the last trial anyway – measured objective increases accepted at the precision floor, ~2×40 objective evaluations per stagnant iteration – and the recorded alpha was one halving past the step actually taken, so that row’s delta_f / rho / step_rel described a step never tried. Now: the default on_line_search_failure='stop' rejects the step and terminates; 'accept' opts into the old take-the-step behavior as a deliberate escape mode (it can bump a stagnant iterate loose); NewtonInfo / stats['history'] gain ls_failed, gradient_descent’s stats gain 'line_search_failed', and alpha now records the last trial actually evaluated.

  • The ragged backend geometries’ inner / point_norm_sq are per-element over the frame stack, matching the uniform twins and the frontend (review H3-5). ManifoldGeometryOps.inner, CorewiseGeometryOps.inner / point_norm_sq, and t3_left_orthogonal_norm_sq used to collapse the stack C to a scalar while UniformManifoldGeometryOps.inner and MANIFOLD.inner returned shape C – a silent cross-layer asymmetry for a raw-.data user composing a stacked loop. Unstacked behavior is unchanged (a 0-d scalar); shipped optimizer paths reject stacked points up front and are unaffected.

  • The uniform manifold frame is gauge-equivalent to ragged, no longer bit-identical. The old bit-equality was an accident of both layers feeding the same matrices to the same LAPACK kernel; the pad-safe sweep (previous section) computes the same subspaces and singular values through a different – still fully deterministic – factorization route, so gauge-carrying cores agree with ragged only up to the SVD’s inherent gauge freedom (column signs, rotations within equal-sigma clusters, the choice of null-space completion). Every gauge-invariant quantity – objectives, gradient norms, optimizer trajectories, represented tensors – still matches ragged exactly. The contract statement for gauge-carrying operations is now in docs/uniform_equivalence_contract.md.

  • jax requested but not installed: run on numpy and warn, never raise. TuckerTensorTrain.randn(use_jax=True) / UniformTuckerTensorTrain.randn(use_jax=True) used to die with a bare NameError, to_jax() / load(use_jax=True) silently returned numpy, and the optimizers’ use_jit=True raised. The policy is now one rule (backend.common.jax_or_warn): the request runs on numpy with a one-time RuntimeWarning naming the t3toolbox[jax] extra – a project developed without jax on one machine and deployed with it on another runs unchanged on both. (use_jit=True with jax present still auto-converts to jax, as in 2026.1.0.)

  • Geometry and kind strings are case-insensitive on the frontend optimizers and uniform_least_squares_problem ('Manifold', 'PROBE_DERIVATIVES', …).

  • adam on a manifold geometry warns: its per-coordinate moments live in the gauge-dependent core coordinates, so its iterates depend on the backend / representation (measured ~1e-2); COREWISE is the intended geometry, mc_sgd / newton_cg the gauge-invariant manifold optimizers.

  • A per-mode residual weight may have more rows than modes. The extra rows are ignored (intended: one weight rides through a continuation scheme that adds modes), now on both layers – the frontend used to reject it while the backend truncated silently. Fewer rows than modes is a structural error on both.

Fixed (continued)#

  • d = 1 on the uniform layer. The uniform boundary-bond squash duplicated the single core, which took down every squashing op (+, -, norm, inner, t3svd, rank_adjustment_sweep, UT3Frame.from_ut3, is_left_orthogonal). A one-mode T3 now degenerates to the vector case on both layers, as intended.

  • A regularized fit of a stacked point silently mis-weighted, and now raises. The data misfit keeps the frame stack C (one value per element) while every regularizer scalar collapses it, so objective = misfit + ρ added the whole-stack regularization total to each element – inflating the effective λ by about |C|, unevenly. The regularizer gradient was per-element correct, which is what made it easy to miss. No test combined stack_shape with a regularizer.

  • A derived sampling kind silently reused its parent’s compiled program. dataclasses.replace copied the hand-maintained identity tuple unchanged, so dc.replace(APPLY, forward=<other math>) compared equal to APPLY; under jit it returned APPLY’s answer (measured: 115.302888 where eager gave 28.825722). Unrepresentable now — a variant is a subclass, hence a distinct type.

Documentation#

  • rank_adjustment_sweep’s orthogonality is conditional, and the docs said so unconditionally: the sweep re-SVDs the TT cores and bonds and preserves Tucker orthonormality but never creates it, so its result is right-/left-orthogonal in the full sense only when the input’s Tucker cores were already orthonormal (any t3svd result) – the documented precondition, now stated at every site. The one real gap behind “compose both directions for guaranteed minimal ranks” – a Tucker rank above its mode size (n_i > N_i), which no TT-side step can reduce – is closed by a Tucker up-SVD at the start of the sweep.

  • A sweep of doc ↔ code mismatches found by the 2026-08-22 review: the README / user-guide core diagram and frame-core listings (d cores, not d+1; up_tucker_cores), the Tucker-rank tuple, the uniform mask form (canonical prefix vs gappy working form), the registered-pytree list (the uniform classes were missing), the paper section cited for probing, stale “slice”/”deferred” module docstrings on the uniform layer, the UT3FrameMasks value-hash comment, chunking.md’s 'auto' default (it is the frontend’s), sharing.md’s “closure state”, six dev/regularization_design.md paths (now in dev/archive/), the t3m_methods.md boundary-bond sentence, the weighting.md recipes and “same operations” claim, the GeometryOps name in the project guide, backend.geometry and corewise in the API reference, and the save/load doctests, which now write into a temporary directory instead of the working directory; and, found by the same review: truncated_svd’s documented truncation rule (it is the tail-Frobenius TT-SVD rule, not a per-singular-value cut), the Geometry protocol’s member list, the shared(…).frame contract row and the rank-deficient-frame retraction caveat in numerical_contracts.md, the corewise transpose’s description in transposes.md (a pullback, not a projection), the λ-vs-draw scaling note, the chunking memory caveats (two-chunk and kept-path regimes), the resize call in the uniform continuation loop, the retired identity-guard wording on T3Tangent, and t3_norm(use_orthogonalization=False), which orthogonalized anyway (it now honors the flag; stack-shape mismatches in +/inner are ValueErrors, as documented).

Performance#

  • The inner CG compiles once per fitting run instead of once per Newton iteration (measured 1 → 0 compiles per iteration on the uniform probe_derivatives path, warm). _cg_solve(local_model, rhs, tol, maxiter, use_jit) dispatches to one function compiled over (local_model, rhs, tol, maxiter), so the cache key is the model’s pytree treedef — value-based, thanks to the change above.

  • mc_sgd / adam per-step kernels compile once per shape signature, process-wide, rather than once per optimizer call: the kernels are module-level functions and the jit wrapper is memoized on them, replacing a per-call closure that discarded its own cache.

  • A user-defined kind or geometry now gets this for free, provided its parameters are dataclass fields.

[2026.1.0] — 2026-08-20#

Added#

  • The explicit equality checks: allclose(other, rtol=, atol=) and corewise_equal(other) on all twelve runtime classes (see the == entry under Changed), corewise.corewise_equal (the bitwise tree comparison underneath), and safety.comparison_rtol (the ambient jax-aware default tolerance for pure comparisons; mode-agnostic, like frames_equal). Train allclose compares the represented TENSORS by norm(a - b) – the difference train through the orthogonalized norm, numerically stable exactly in the a ~= b optimization-residual case.

  • Scalar-left multiplication and scalar division on the point/tangent classes (review R1-12 / H4-8): TuckerTensorTrain gains __rmul__ (2.0 * x used to raise while x * 2.0 worked), and TuckerTensorTrain / UniformTuckerTensorTrain / T3Tangent all gain scalar-only __truediv__ (x / 2). The ragged weighted frontends t3_weighted_norm / t3_weighted_inner gain the use_orthogonalization kwarg their backend and uniform twins always had (review H2-6), and check_fw_pair is exported as the docs already said (review R10-7). Per-axis uniform sum_stack(axis=) is deferred-and-documented (review H2-7; contributor/deferred_and_rejected.md).

  • backend.linalg.pad_safe_svd – the mask-aware SVD of a zero-padded matrix: the first min(n, m) triplets are exactly the economy SVD of the unpadded real block, bitwise zero on the padding, with no rank tolerance anywhere and one jit compile across mask patterns (masks are runtime data). Batched, backend-agnostic, symmetric in (n, m) (wide real blocks need no caller-side transpose), deterministic (fixed Haar sketch per width). The algorithm is Method D (“sketch-project”) of the pad-safe SVD design packet, dev/review_2026-08-22/repros/S1b/packet/: pads are permuted to the trailing QR pivots (Householder reflectors then never touch a padded row), one small augmented SVD pins the surplus, and the right factor is rebuilt from A^T U = V diag(ss). The uniform sweeps use it wherever an SVD produces kept basis columns. The complete derivation note – problem, contract, algorithm, measurements, and the alternatives considered – is docs/pad_safe_svd.tex (+pdf).

  • Shared Tucker factors (SF-T3) — optimize over Tucker tensor trains whose Tucker factors are constrained equal within user-specified groups of modes (the SF-ETT decomposition of Molozhavenko & Rakhuba (2026), generalized from one trailing block to an arbitrary partition; the partition is always user-provided). A sharing spec is one hashable group label per mode, e.g. (0, 0, 1); a shared T3 is an ordinary TuckerTensorTrain whose group factors are equal (redundant storage — a compute-not-memory feature). Ragged layer and its full uniform mirror:

    • The shared geometries — shared(MANIFOLD, sharing) with shorthands shared_manifold(sharing) / shared_corewise(sharing), exported from the package root: drop-in geometry wrappers for every optimizer and fitting model. Projections post-pass onto the tied tangent subspace in the base geometry’s own metric (manifold: the tilted least-squares projection through a per-frame SVD companion; corewise: the per-group mean), and the manifold retraction goes through a tied doubled-rank embedding plus the grouped t3svd, so every iterate stays exactly tied (one array per group).

    • Grouped t3svd(sharing=) / rank_adjustment_sweep(..., sharing=) — the paper-faithful two-phase truncation (TT rounding, then simultaneous group Tucker SVDs on concatenated matricizations), reporting one spectrum s_g per group; sharing=None or an all-singleton partition is the existing sweep exactly.

    • TuckerTensorTrain.share(sharing, ...) — the quasi-optimal shared initializer (exact common-span rewrite + grouped truncation), and the checker method has_shared_tucker_factors(sharing, rtol=) (per-stack-element bool).

    • Shared rank bookkeeping — get_minimal_ranks(..., sharing=) / backend.ranks.compute_minimal_ranks(sharing=) with the group ceiling n_g <= min(N_g, sum_i min(N_g, rL_i*rR_i)) (per-mode ceilings ADD across a group, so a shared rank may exceed an individual mode’s rL_i*rR_i — the unshared reduction would clip it and untie the group), manifold.manifold_dim(s, sharing=) (one Stiefel term per group; validated against dense tied-tangent ranks), and frame_has_minimal_ranks(..., sharing=).

    • Shared rank continuation — continuation_ranks(sharing=) / backend.ranks.compute_continuation_ranks(sharing=): a group’s Tucker edges are ONE edge — one κ_g = s_g[0]/s_g[-1] in the conditioning pool, one growth decision applied group-wide, one max_grow candidate — with the shared useless-rank removal (κ_g is never worse than the group’s worst per-mode condition number, and can be far better on complementary spectra). Plus resize(..., sharing=) for the zero-padded warm start: the group factor is padded once (one array per group), the represented tensor unchanged. A freshly padded restart carries exactly-zero new spectrum levels (the tied Tucker channel is gated); the escape runs through the untied TT-variation channel within the first Newton steps — which is why full shared rank is a diagnostic, never an enforced precondition.

    • Uniform mirror, grouped truncation family — UniformTuckerTensorTrain.t3svd(sharing=) / rank_adjustment_sweep(..., sharing=) / has_shared_tucker_factors(sharing, rtol=), backend ut3svd(sharing=) (the two-phase grouped sweep in scan/supercore form: TT-bond rounding scan with the Tucker steps skipped, centers collected by the polymorphic right sweep, per-group SVDs on statically-gathered concatenations — mask-only truncation, ONE group rank mask at every group mode), ut3_rank_adjustment_sweep(sharing=), the grouped host recurrence compute_raw_sweep_ranks(sharing=) (verified == the ragged grouped output ranks over randomized structures/caps), the masked checkers ut3_sharing_residual / ut3_tucker_factors_shared, and a sharing-aware uniform_minimal — required: the per-mode reduction silently unties a shared uniform start (it can clip a group rank to unequal per-mode values). All verified under the uniform equivalence contract (== the ragged grouped ops on real parts, per stack element, varying-rank stacks included), with exact output-mask assertions, garbage robustness, and jit-clean dispatch.

    • Uniform mirror, tied tangent machinery — the uniform companion ufv_shared_frame_data (the identical polymorphic derivation on the frame’s stored supercores — deliberately NOT re-masked: the companion’s exactness rests on reproducing the construction’s own sweep on the same arrays, and the padded rows of each S_i^T vanish because completion rows are orthogonal to the centers’ row space), the tied post-passes ufv_share_tucker_variations / ufv_share_tucker_variations_corewise (mask-and-delegate to the polymorphic ragged solves), and shared_data= threading through utv_orthogonal_gauge_projection / utv_to_ut3 (the TIED doubled-rank embedding: Udot at every group mode, the companion’s centers replacing the down cores, the variation block rebuilt at the up width) / utv_retract (tied embedding + the grouped ut3svd). Verified gauge-invariantly against the ragged twins (dense tangents/points at machine precision; outputs exactly tied).

    • Uniform mirror, shared geometries + fitting — shared(UNIFORM_MANIFOLD, sharing) / shared(UNIFORM_COREWISE, sharing): the SharedGeometry wrapper now takes the uniform singletons too (uniform points/frames/tangents in and out; same value-hashed identity), the backend factories take sharing= (uniform_geometry_ops and both singles — the closures capture the partition beside the masks and populate precompute with the uniform companion), uniform_least_squares_problem(sharing=) with a shared-minimal gate, and the frontend fitting models carry the companion as a geometry_aux leaf (UniformGaussNewtonModel), so the packed compile-once path holds for shared fits (one trace across rebuilt same-rank models). All four optimizers run shared on the uniform layer; deterministic trajectories match the ragged shared runs, and every iterate stays exactly tied.

    • Docs: the user page docs/sharing.md (the format, the grouped truncation, what the group spectrum is, the two geometries, rank machinery, batching, uniform, scope — including sharing ≠ symmetry); the design record docs/contributor/sharing_internals.md; a shared section in the CI-doctested getting-started tour; the sharing section of docs/rank_continuation.md; and the TIED precondition rows in docs/numerical_contracts.md.

    • Weights × sharing — the combination composes within the existing framework (absorbing keeps a tied T3 tied iff the group Tucker weight vectors are equal; TT-bond weights never touch the factors; from_t3svd(x, sharing=…) builds group-equal weights; the weight algebra preserves group-equality), so the only addition is the non-enforcing compatibility checker: T3Weights.has_shared_tucker_weights(sharing, rtol=) and the UT3Weights twin (masked content), with t3_tucker_weights_sharing_residual / t3_tucker_weights_shared (+ ut3_*) in backend.sharing. Nothing gates — absorbing group-unequal weights legitimately unties.

    • Example: examples/fit_shared_factors_jetted_probes.py — a groupwise-symmetric five-mode target (two Hilbert tensors coupled by a random matrix; two sharing groups of different mode sizes) fit from noisy probe-derivative jets, running the SAME rank-continuation fit shared vs unshared: tying the factors the target’s symmetry justifies reaches ~35% lower true error with ~37% fewer parameters before overfitting.

    • Entering the format is the geometry’s job. shared(...).frame(x) ties an untied x first, silently, by the per-group mean — so an untied initial guess is a non-event for the optimizers, and the slow drift a long run of low-precision first-order steps can produce is absorbed at the next frame. An already-tied point is a bitwise fixed point, so the ordinary path is unchanged. The uniform layer gets the same route without a round trip through ragged: ut3_tie_tucker_factors, the twin of t3_tie_tucker_factors (garbage-transparent, so it needs no masking; masks and TT cores untouched). The shared corewise retraction ties the sum rather than aliasing one mode’s copy of it, which makes it total: mean_i(U_i + V_i) = mean_i(U_i) + mean_i(V_i), so an untied tangent (always handled) and an untied base point both land on the shared set with nothing silently discarded. The TIED-tangent precondition is now one backend checker — fv_tied_variations_residual / ufv_tied_variations_residual, a single global Frobenius ratio per stack element — replacing two hand-rolled formulas that disagreed between the ragged and uniform paths and collapsed the whole stack into one scalar (so one untied stack element could hide behind many tied ones).

    • Backend surface in backend.sharing (validate_sharing, t3_sharing_residual, t3_tucker_factors_shared, t3_tie_tucker_factors, SharedFrameData + fv_shared_frame_data, the tied post-passes) and backend.t3_svd.t3_share_tucker_factors. Safe mode checks tied factors at shared entry points; full shared rank is a diagnostic, never a precondition (rank-continuation restarts legitimately sit below it).

  • The grouped-einsum interpreter backend.contractions.contract — one general entry point for every grouped contraction: contract('WCa,Caib,WCi->WCb', *operands, len_W=...). Standard einsum strings where an UPPERCASE letter is a group of zero or more axes (W probe stack, K tangent stack, C frame stack, …); group sizes are solved exactly from the operand ndims (identifiability is decided from the subscripts alone — a call site either always needs a len_<G> supplement or never does, and the error names precisely what is missing); groups expand into fresh single-axis letters and one ordinary einsum runs on the operands as given. No reshape ever happens, so every sub-axis of every group is shardable (compiler-verified across the whole library vocabulary) and fusing two groups is inexpressible. numpy keeps the greedy pairwise BLAS path (computed on the grouped string); jax gets a single fused einsum.

  • Weighting (edge weights) — diagonal weights on the internal edges of a T3, as a lightweight data format plus absorb into cores, in both the ragged and uniform representations. Two classes per layer, because a tensor and a tangent have genuinely different edges:

    • T3Weights / UT3Weights weight a Tucker tensor train as a tensor (tucker[d], tt[d+1] — exactly the shape t3svd returns, so the singular values are the canonical weight object).

    • T3FrameWeights / UT3FrameWeights are a metric on a tangent’s coordinates (up/down/ left/right, each len=d) — the Grasedyck–Kramer preconditioner — absorbed into the variation cores with the frame left orthonormal, so they are O(ranks).

    • Operations on all four: absorb_weights, weighted_norm / weighted_inner, reciprocal / sqrt, and concatenate / kronecker (the + / ⊙ duality: ranks add / multiply). Constructors from_t3svd / from_ut3svd and from_t3weights / from_ut3weights, plus ragged↔uniform conversions for both weight types.

    • The frontend free functions carry the family prefix — t3_absorb_weights, ut3_absorb_weights, fv_absorb_weights, ufv_absorb_weights (+ t3_/ut3_weighted_norm / _weighted_inner) — and the whole surface is exported from the package root. Docs: docs/weighting.md; design records: docs/contributor/weighted_internals.md.

  • Regularization on the fitting objective — regularizer= on every optimizer (gradient_descent / mc_sgd / adam / newton_cg) and on the six model factories, minimizing ½‖ω⊙(S(x) − y)‖² + ρ(x). Shipped implementation: IdentityRegularizer(λ) = ½λ‖x‖² — a Hilbert–Schmidt ridge on MANIFOLD, weight decay on COREWISE — composing with every optimizer, sampling kind, geometry and representation (ragged and uniform), with λ auto-scaled by batch/n in the minibatch steps so the stochastic objective is an unbiased estimate of the full one. Extensible through the small Regularizer protocol in backend/regularization.py. Docs: docs/fitting_and_optimization.md §4.9; example examples/fit_hilbert_regularized.py (denoising, with λ chosen by held-out validation).

  • Per-mode residual weighting — the fitting layer’s residual weight ω generalizes from a per-order vector to an ω[mode, order] matrix, owned by the sampling kind: probe_model(weight=) takes a length-d per-mode vector and probe_derivatives_model(weight=) a (d, order+1) matrix (probe is the only kind with a per-mode axis, so apply/entries stay per-order). A bare vector is still read as per-order, so existing calls are unchanged. Docs: docs/fitting_and_optimization.md §4.6; example examples/fit_per_mode_weight_probes.py (inverse-noise weighting of a noisier mode).

  • Newton-CG diagnostics — newton_cg(..., verbose=True) prints a per-iteration block (objective and gradient norms, CG statistics, line search, ρ, wall time) plus a per-(mode, order) relative-error table, with an optional held-out validation column via val_sample= / val_data=; the same records are returned in stats['diagnostics'] and stats['history'], and a regularized run splits the objective as obj = misfit + reg. Backend-owned (backend.optimizer_display.make_newton_display + a callback= hook), so a raw-.data user gets the identical display; ragged and uniform. Example examples/fit_probe_display.py.

  • Newton-CG warm-start controls — g0norm_newton / g0norm_cg pin the reference ‖g₀‖ that the Newton stopping test and the CG forcing term are measured against (the computed initial norm is misleadingly small after a rank-continuation warm start; g0norm_newton also feeds CG unless g0norm_cg is given), and cg_forcing_power (default 0.5) trades CG iterations per Newton step against the number of Newton steps. NewtonInfo.g0norm reports the effective reference. Docs: docs/fitting_and_optimization.md §5.

  • chunk_size for the probe-derivative transpose — the 𝒥ᵀ variation assemblies are computed in chunks over the probe stack W, trading recompute for peak memory: chunk_size (default 100, None = dense) threads through the whole transpose chain and both T3Tangent / UT3Tangent.probe_derivatives_transpose, and the optimizers accept chunk_size='auto' (the default), which sizes it from x0’s shapes. The sizing helpers backend.sampling_derivatives.estimate_chunk_size / max_chunk_size_within are eager (outside jit), measure the per-row cost by lowering the real kernel rather than estimating it analytically, and take an n_shards= for per-device sizing and a stack_shape= for a batch of base points (the frame stack C multiplies the assembly but not an absolute byte budget, so omitting it on a stacked frame would make max_chunk_size_within return a chunk up to prod(C) times too large). Docs: docs/chunking.md.

  • Recurrence/scan jets are now the standard derivative path — the pushthrough, combine and variation-assembly jets are computed by affine two-term recurrences and order-scans rather than by contracting the dense binomial trs tensor. The lean forms own the canonical names (compute_mu_jets, compute_eta_jets, compute_{sigma,tau}_jets, compute_deta_jets, the tilde twins, and assemble_{tt,tucker}_variation_jets); the dense forms remain public as the *_trs reference twins (numerically equal, and the test oracle). Under jit on the uniform layer this is a large memory win at unchanged accuracy — measured at rank 128, W=32000: ~14–28× less XLA temporary for the eta jets and 168 GB → 2.63 GB (64×) for the TT-core variation assembly. (Not all of them, as shipped: several kernels kept dense trs contractions until 2026.3.0 – see there.)

Changed#

  • BREAKING: the backend optimizers.GeometryOps protocol gains an optional precompute slot (frame -> geometry aux, None for the existing geometries), and project/retract take a third argument ((frame, variations, aux=None)). Problem.local_model builds the aux once per Newton step (a LocalModel.geom_aux leaf field beside sweep) and passes it to project/retract; the frontend GaussNewtonModel mirrors it as a geometry_aux leaf. Migration for custom GeometryOps: accept (and ignore) aux=None in project/retract; the shared geometries use the slot to compute their per-frame SVD companion once per local model instead of once per CG matvec.

  • The Regularizer protocol threads the geometry aux: gradient/hessian/quadratic gain an aux=None parameter (the per-frame geometry companion, e.g. the SF-T3 SharedFrameData), and every model/LocalModel call site passes its stored companion — closing the one seam where a regularized shared fit rebuilt the companion per CG matvec. Custom Regularizer implementations: accept (and may ignore) aux=None. Design record: docs/contributor/precompute_and_caching.md (the precompute/caching principle and audit).

  • backend/common.py gains prefix_mask (the boolean prefix indicator shared by every uniform prefix structure) and now hosts require_concrete_masks, which moved from backend/ut3_masking.py — it is infrastructure for the uniform mask-representation contract, not part of any one object family.

  • use_jit=True now converts its inputs to jax instead of silently running eager. Previously the flag was accepted but ignored unless x0 / sample / data were already jax arrays, so a “jit” run could be an eager one (and a meaningless benchmark). Requesting jit is now taken as opting into jax-world precision: x0, problem.sample and problem.data are moved onto jax, the result comes back jax-backed (float32 unless jax_enable_x64 is set), and the call raises if jax is not installed. use_jit is also now an explicit keyword on newton_cg / mc_sgd / adam rather than arriving through **kwargs. Docs: docs/fitting_and_optimization.md §4.5.

Fixed#

  • A GaussNewtonModel built from a parameterized sampling kind recompiled on every rebuild. The model carries its SamplingKind as jax pytree aux_data, and jax keys its compilation cache on the aux; the derivative kinds and the weighted probe kind are built per model out of fresh closures, which under dataclass field equality never compare equal. So the documented “roll your own optimizer” pattern — rebuild the model at each outer point, jit a function of it — paid a full recompile every step (measured: 3 traces for 3 rebuilds, against 1 for the apply/entries/probe singletons). SamplingKind now compares on a value identity (name, order, residual weight, chunk_size) rather than on its closures, so a rebuilt kind with the same parameters is the same cache key while a genuinely different one still gets its own compilation. The uniform model already did this through its value-hashed aux; the ragged twin now matches, and both are pinned by regression tests.

  • backend.fv_conversions ignored squash_tails=False — the parameter was shadowed inside the function, so the tails were squashed regardless of what the caller asked for.

  • The uniform frame/variation entry points (ufv_apply_frame_masks, ufv_apply_variations_masks, ut3frame_to_t3frame, ut3variations_to_t3variations) accepted traced masks and failed deep inside jax with a TracerArrayConversionError; they now call require_concrete_masks and raise the actionable message, like the plain-layer entry points already did.

Removed#

  • BREAKING: the ~104 named contraction functions in backend.contractions (WCa_Caib_WCi_to_WCb-style), replaced by the contract interpreter above. Migration is mechanical: the function name is the subscripts string (X_Y_to_Z(a, b) → contract('X,Y->Z', a, b)), and the trailing n_probe / n_frame arguments become len_W= / len_C= keywords. Numerically identical (each named function was verified equal to its contract call over an empty/single/multi-axis block-shape matrix before removal).

  • The old parked weighted layer (weighted_tucker_tensor_train.py, backend/wt3_operations.py, the wt3_ prefix, and the broken absorb_weights_into_tangent_cores), superseded by the above.

[2026.0.0] — 2026-07-13#

The first public release — the initial public surface:

  • The Tucker tensor train (T3) format — arithmetic with dense-tensor semantics, orthogonalization, minimal ranks, T3-SVD, save/load, batching on every operation.

  • The three sampling operations (entries / apply / probe), their symmetric directional derivatives, and the ambient/corewise/tangent transposes.

  • The fixed-rank T3 manifold: orthogonal frame + gauged variations, tangent vectors, gauge projections, retraction, and the MANIFOLD / COREWISE geometries.

  • Least-squares fitting from any sampling operation or its derivatives (Gauss-Newton models) with four optimizers (gradient_descent, mc_sgd, adam, newton_cg).

  • The uniform layer: supercores + boolean rank masks mirroring the whole stack, for jax.lax.scan vectorization and compile-once jit (optimizers included).

  • NumPy / JAX backends with dispatch inferred from input array types; safe mode for numerical-precondition checking.