Skip to content

Changelog

All notable changes to Hyperbolix will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

[1.5.1] - 2026-11-16

Fixes from an audit of 1.5.0. Two defaults change: HypConv2DHyperboloid's init, and the output curvature of layers that take c_in and c_out. The rule that a manifold's dtype decides now also holds for a float64 c and for NumPy input. Apart from the two defaults and the fixes listed below, float32 results with a Python-float c and jax_enable_x64 off are unchanged, except for rounding-level changes in uniform_poincare.log_prob and in the gradient of lorentz_residual with respect to a learnable c. That comparison was made on the lockfile's jax 0.9.1. With jax 0.12 the input gradients of sinh_lift_to_hyperboloid, HypLinearHyperboloidPLFC and HypRegressionPoincare also change in the last bit (relative 3e-7 at most) for a c that float32 does not represent exactly, because c now enters as a float32 array instead of a weakly typed Python scalar; values are bit-identical there too.

Changed

  • Values change: HypConv2DHyperboloid defaults to reset_params="fan_in" (normal, std = sqrt(1/hcat_out_ambient_dim), zero bias). The previous default U(-0.02, 0.02) shrank the spread of the spatial coordinates by a factor of 0.13 to 0.14 per layer, to about 3e-4 after four layers (16 channels, 3×3 kernels, c = 1), so a default-built stack froze without any NaN; fan_in keeps each layer between 0.98 and 1.09. reset_params="uniform" restores the old init, and "default" stays accepted as an alias of it with bit-identical kernels. The old default was the FHCNN linear layer's init, not the reference conv's (Bdeir et al. 2023 draw kernel and bias from U(-s, s), s = sqrt(2/((C-1)·k²))). See the initialization table.
  • Values change: c_out and c_attn default to c_in instead of 1.0, in HTCLinear, HRCDropout, HRCLayerNorm, HRCRMSNorm, HRCBatchNorm, FGGMeanOnlyBatchNorm, HyperbolicFullAttention, HyperbolicLinearAttention and HyperbolicSoftmaxAttention. A call that passed only c_in=0.1 used to place its output on the c = 1 sheet without an error; the transformer-block example in the layer guide did exactly that. Calls that pass every curvature, or none, are unchanged.
  • Values change with jax_enable_x64 on: FGG layers draw their initial weights in float32 (float64 for a float64 param_dtype), so a seed gives FGGLinear and FGGConv2D the same weights with and without x64 (FGGConv2D with reset_params="kaiming" or "xavier" to one float32 rounding step). Before, an x64 process drew from the float64 stream and got different weights of the same scale. FGGLorentzMLR was not affected. Without x64 the weights are unchanged bit for bit.
  • Values change for HyperbolicFullAttention(score_dtype=...): see Fixed.
  • Minimum Flax version is 0.12.5 (was 0.12.0). At the old floor import hyperbolix failed (ImportError: cannot import name 'mutable_array'), and nnx.view reaches the library's layers only from 0.12.5. The test suite passes at jax 0.9.0 with flax 0.12.5.
  • HyperboloidGyroRMSNorm, ProperVelocityGyroRMSNorm and PoincareGyroRMSNorm raise ValueError when the input's last axis does not match num_features (plus the time slot on the hyperboloid). Without a bias a wrong width used to pass silently; with a bias JAX raised a TypeError.
  • Values change at the 1e-6 level: HypConv2DPoincare and Poincare.beta_concat compute their beta-function scale in double precision. The scale B(n/2, 1/2) / B(n_i/2, 1/2) was computed with jax.scipy.special.beta in JAX's default dtype: in float32 it lay up to 1.3e-6 relative from the true ratio (12 rounding steps at one input channel and a 3×3 kernel, up to 17 steps at other kernel sizes), and a layer's scale differed between processes with and without jax_enable_x64. It is now one Python float from math.lgamma (hyperbolix.manifolds.poincare.beta_concat_scale), the same in both. Outputs of these two change by that relative amount (under x64 a float64 scale moves too, by up to 6e-7: JAX's float64 beta was that far off at 16 input channels).
  • Layers reject a manifold of another model. The manifold_module check looked only at method names, which the models share: 13 of the 29 layers that take a manifold (for example HypLinearPoincare, HypLinearPV, HypRegressionHyperboloid, HypLinearHyperboloidFHNN/FHCNN/PLFC and the gyro norms) accepted an instance of another model and computed with the wrong geometry. They now check the class and raise TypeError; subclasses are accepted, and Stereographic stays accepted by the Poincaré layers whose methods it has (HypLinearPoincare, HypRegressionPoincare).
  • hope and hope_rotate_space raise ValueError on an odd spatial dimension (before: a TypeError from inside a reshape). sample of both wrapped normals names the problem when it gets a stack of covariances (before: a ValueError from inside jax.random.multivariate_normal); log_prob takes one covariance per mean, as before.
  • ProductManifold raises ValueError when a factor was built with another dtype than the product. Each factor computes in its own dtype, so ProductManifold((Poincare(dtype=jnp.float64), 2), ...) with the default dtype=jnp.float32 returned float64 from every method that returns an array under jax_enable_x64. Build the factors with the product's dtype, or pass the factors' dtype to ProductManifold; ProductManifold.from_signature already did.

Fixed

  • A float64 c promoted float32 outputs to float64 under jax_enable_x64. A NumPy float64 or a float64 JAX array as c turned the output of most hyperboloid layers and functional ops (hyperboloid_core, the HRC/HTC layers, activations, norms, PLFC, FHCNN, ILNN, FGG, and through them attention, residual and positional layers), of HypConv2DPoincare, HypRegressionPoincare, the Busemann layers and HyperPPFeatureScaling, of the isometry maps hyperboloid_to_poincare, poincare_to_hyperboloid and poincare_to_pv, of both wrapped-normal log_probs, and of HoroPCA and CoSNE into float64. Values agreed to float32 rounding; the dtype did not. HoroPCA.fit raised a TypeError in its Fréchet-mean loop in that case. A float64 input to a float32 manifold likewise promoted the Busemann heads. All of these now cast at the function boundary. The same casts round c to the input's dtype for bfloat16/float16 inputs, where a float32 learnable c used to promote the output to float32.
  • HRCBatchNorm(param_dtype=jnp.float64) kept float32 running statistics. Flax's nnx.BatchNorm creates its running mean and variance in float32 whatever param_dtype says, so a float64 layer stored float32-rounded statistics (3e-8 relative) and normalized with them in eval mode. They are now created in param_dtype, and stay float32 for float32 and half-precision parameters. A float64 checkpoint saved before this release restores its float32 statistics.
  • A float64 weight promoted lorentz_residual's float32 output under jax_enable_x64 (a NumPy scalar, a 0-d or a per-point float64 array as w_y). Strongly typed array weights are cast to the input's dtype; a Python-number weight is unchanged bit for bit.
  • NumPy points were not cast to the manifold's dtype. On every manifold a NumPy point gave float64 output from a float32 manifold under x64, and Hyperboloid.egrad2rgrad, HalfSpace.proj and ProductManifold.egrad2rgrad raised AttributeError on NumPy input with or without x64.
  • Wrapped-normal log_prob with one point against a batch of means (z with fewer leading axes than mu) was broken: the Poincaré log_prob returned wrong numbers without an error when the batch size equalled the dimension and raised otherwise, and the hyperboloid log_prob raised for every batch size. z and mu now broadcast; a mean batch of size 1 against several points works too.
  • Float32 uniform_poincare.log_prob was -inf inside the ball once the volume overflowed (n = 11, R = 10: now −93.80). The log-volume is computed in log space.
  • HyperbolicFullAttention(score_dtype=jnp.float64) gained at most about 2× over the float32 default, and nothing in the attention weights at a = 12. It cast the stored float32 time coordinates, which carry their own rounding, into the cancelling score. It now casts only the spatial parts and rebuilds both time coordinates in float64. At scaled radius a = 8 (c = 1, τ = 1) the largest attention-weight error against a float64 layer drops from 0.14 to 3.4e-5 (float32 default: 0.21), and the largest score error from 1.06 to 4.9e-4. Values change for score_dtype users only; score_dtype=None is bit-identical. See the attention score floor.
  • LorentzMoE closed over inside jax.jit, jax.vmap or jax.lax.scan raised flax's "Cannot extract graph node from different trace level". Passing the module as an argument, and nnx.jit, already worked, and their outputs are bit-identical.
  • HypConv2DPoincare could not be built inside jax.jit or nnx.jit. Its constructor called float() on a traced beta-function ratio and raised ConcretizationTypeError, like the four layers fixed in 1.5.0. The ratio is now evaluated at compile time; its value is unchanged bit for bit.
  • HypVQEmbeddingPoincare projected its codebook only at init, at c = 1. With init_scale=0.3 and c = 2.5, 52 of 64 codes lay off the ball and stayed there through the EMA updates. The forward and ema_update now project at the call-time c. With the default init_scale=1e-3 outputs and codebooks are bit-identical.
  • HyperbolicRoPE did not check its dim: HyperbolicRoPE(dim=4) rotated points of spatial dimension 8, and an odd dimension failed with a reshape error. An odd dim now raises ValueError at construction and a mismatched input at call time. max_seq_len is documented as having no effect.
  • LorentzEmbedding's docstring said every out-of-range id gives NaN rows; ids from −V to −1 wrap around like Python indices.

Removed

  • The unused private helper hyperboloid._ptransp_to_0.

Tests

  • The suite passes on an A100 at JAX's default matmul precision. With 1.5.0, 18 float32 tests of LorentzMLA and LorentzMoE failed there: they compare a float32 layer with a float64 transcription, or one batch shape with another, at 2e-5 or tighter, and the layers' weight GEMMs (HTCLinear, the gate product) follow the JAX default by design, which is TF32 on that card (the failing comparisons were 1e-4 to 1.6e-2 off at the default and at most 1.2e-5 under "highest"). The tests now pin full float32 products. No layer was wrong and no library code changed for this. One of them, the comparison of a batch of 2 with two batches of 1, also gets a GPU tolerance of 5e-5 (was 1e-6): the GPU's rounding there depends on the batch shape and varies between processes (2.9e-6 to 7.6e-6); on CPU the tolerance stays 1e-6.

Packaging

  • The wheel and sdist ship py.typed (the Typing :: Typed classifier was already declared) and the LICENSE file (PEP 639 license = "MIT"); the metadata lists Python 3.13.
  • chex is no longer a dependency; nothing imported it.
  • The README installs with pip install hyperbolix, and its logo and links are absolute URLs, so they also work on PyPI.
  • RAdamState and RSGDState are exported from hyperbolix.optim.

Documentation

  • Numerical-stability guide. The hyperboloid's float32 limit is stated as an error law instead of "good to 16.6": the dist error grows as eps·sinh(a), with a median of 5e-4 at a = 12 and 6e-2 at 16.6 for pairs at distance 1. The wrapped-normal gradient error at a far mean is given against the unrounded points (about 5e-3 at a = 12, 0.3 at a = 16); the old numbers left the storage rounding out. Corrected: the behaviour of a wrapped normal with a mean past a ≈ 44, the float32 errors of the tangent-input Poincaré layers at t = 8, and the aligned Busemann direction at t = 20. New sentences cover effects below or outside training radii: dist with an endpoint at the exact origin (absolute error 5e-16; dist_0 has none), float32 underflow of distances for coordinates below 1.1e-19, Jacobians at the Möbius floor for operands of norm below 1e-15, the c-derivative error of about 3·eps/(c‖x‖²), second derivatives in c at the origin, busemann near the origin, the tanh derivative in the tail, and the Poincaré ceiling at c = 100 (10.35 / 25.42).
  • Numerical-stability guide, TF32. On an A100 at the JAX default, small float32 products run in full precision and larger ones in TF32 (a single row in full precision at every width tried; a 5 → 12 product switches between 7 and 8 rows), so a sample evaluated alone can differ from the same sample inside a batch by the TF32 error: 3.3e-3 for LorentzMLA at its test size, against at most 7.6e-6 under jax_default_matmul_precision="highest".
  • Numerical-stability guide: the attention score-floor formula is stated as the size of the error, with the measured spread (median score about half of it, worst of 144 scores about 1 to 4 times it); the wrapped-normal note on a mean cast from float64 says where the value itself turns wrong (from about a = 87.2, by up to 0.3 %).
  • Numerical-stability guide, corrections from re-measuring it: the old slot-2 acosh form of Poincare.dist_0 flattened float32 radii below 7.7e-4/√c onto the constant 1.5e-3/√c (the guide said below 1.1e-3/√c onto 0; the 1.2.0 entry below is corrected too); the literal residual square's gradient error is about three times that of the residual's output (not "three times sooner" in radius); gyro addition is no longer listed as cancellation-free (float32 result off by 3 to 22 % when operands at scaled radius 8 and 7.5 on opposite rays give a result at 0.5); the "gemm" centroid number names its setup (values on one ray, c = 0.5) and the half-angle MLR cost its hardware.
  • Numerical-stability guide, new limits (all outside the documented working ranges, values right in each case): within about 2 of the float32 coordinate limit the gradient of hyperboloid dist with respect to the far point is wrong on CPU (reverse mode at c = 1: off by 0.2 at scaled radius 44 to 44.25 in dimension 2, by 0.6 to 1 at 44 in dimension 64; an A100 is right up to the limit); the half-space expmap_0 has a non-finite float32 jacrev for an exactly vertical step from θ ≈ 33; Hessians of Möbius addition and expmap at an exactly zero operand or tangent are wrong in both dtypes, and float32 Hessians of expmap in a small tangent are unreliable; the Jacobian of Poincaré expmap in the tangent carries a relative error of order eps·λ_x (about 1e-4 at scaled radius 8 in float32); float32 Poincaré origin maps have a NaN c-derivative at c = 1e-10.
  • Numerical-stability guide, GPU numbers re-measured on an A100 (jax 0.9.1): float64 is not "half rate" there (a 4096 × 4096 matmul runs at 15 TFLOP/s in float64, 17 in full float32 and 90 to 100 at the TF32 default), and four HTCLinear or FGGLinear layers (width 256, batch 2,048) cost 5 to 25 % more in float64; a TF32 product carries about 3e-4 relative error (1e-3 is the format's machine epsilon); "highest" costs +10 % to +25 % on a HyperbolicFullAttention forward, depending on the session (was +5.5 %, a single-process measurement); the forward-plus-backward step of LorentzMLA with the "variance" centroid compiles in about 55 s at S = 512 (the 104 s was measured once in another project's Python environment; the 2026-09-30 code compiles in 62 to 65 s in this one), and a forward-only jit takes about 9 min; the replay's median logit gap is given with its value at initialisation. The FGGLinear, HTCLinear depth-16, HELM-MiCE LorentzMLA and Klein.dist numbers reproduce.
  • lorentz_midpoint's docstring says that the weights of a row should sum to about 1: below a sum of sqrt(eps) ≈ 3e-4 the floor can bind and move the midpoint toward the origin.
  • Docstrings: the examples of get_manifold_info and has_manifold_params run as written; HypLinearHyperboloidFHNN's init is attributed to the machine-translation code of Chen et al. 2021 (their graph code uses U(-1/sqrt(out), 1/sqrt(out))).
  • The optimizer and layer guides name LorentzEmbedding (default parameterization="manifold") among the layers that need a Riemannian optimizer. getting-started no longer says c = 0 is Euclidean for every model. The attention page gives the mask fill as -1e18. The init table gains rows for HypConv2DHyperboloid and HypRegressionHyperboloid. The API reference documents Curvature, ScalarCurvature, AUTO and Auto.
  • Docstrings: the examples of riemannian_adam, riemannian_sgd, hyperbolix.optim, ProperVelocity and hyp_avg_pool2d run as written; HypConv2DPoincare(id_init=True) is described as the reference's 1/2 · eye(C_out, K²·C_in), which is not a channel identity.

1.5.0 - 2026-10-30

Train/eval modes now reach every batch-norm and dropout layer through model.eval(), model.train() and nnx.view. The FGG layers compute their Minkowski product in full float32 on Ampere/Hopper GPUs, and several base-point Jacobians near the origin are fixed. Two HELM options that could give NaN are removed (breaking).

Added

  • LorentzMLA(score_precision=...). The precision of LorentzMLA's two attention-score einsums is now a constructor argument. The default stays MATMUL_PRECISION (HIGHEST), so outputs are unchanged. At the radii of the trained HELM-MiCE 120M model, DEFAULT took 0.74× the time and gave a worst-token error of 0.035 against 0.017 nats. The centroid GEMM stays pinned, because lowering it cost 0.26 nats. It is the one geometry dot a user can lower; every other geometry dot stays pinned. See the attention score floor.
  • FGGMeanOnlyBatchNorm(use_running_average=...) and update_running_mean=. The mode is now a constructor attribute, as in nnx.BatchNorm, so model.eval(), model.train() and nnx.view reach the layer. Before, only the call argument switched it, and model.eval() left it in training mode. The call argument now defaults to None, which uses the attribute; the constructor default stays False. The call-time update_running_mean=False centers with the batch mean and skips the running-mean write. It is meant for a call inside a JAX transform that does not carry the module as state, such as a module closed over in nnx.fori_loop, where the write raises flax's TraceContextError.
  • set_view on PoincareBatchNorm2D, HyperboloidGyroBatchNorm, ProperVelocityGyroBatchNorm, FGGMeanOnlyBatchNorm and HypVQMLRPoincare, so nnx.view(model, use_running_average=True) (or deterministic=True) reaches them. HRCBatchNorm already followed its inner nnx.BatchNorm.
  • HRCDropout, HypLinearHyperboloidFHNN and HypConv2DHyperboloidFHNN follow model.eval() / model.train() / nnx.view. Their call-time deterministic defaulted to a fixed bool and overrode the inner nnx.Dropout's own setting: model.eval() left HRCDropout dropping, and model.train() never switched on the FHNN layers' dropout. The call default is now None, which uses the inner nnx.Dropout's setting, and a new constructor deterministic sets its starting value. The defaults are unchanged: HRCDropout drops (False), the FHNN layers do not (True).
  • FGGLinear(init_kernel_scale=...) and FGGConv2D(init_kernel_scale=...). Under use_weight_norm=True it sets each output column's norm at init. The default None keeps the reference init, kernel_scale = sqrt(1/(in+out)), which is a column norm of softplus(sqrt(1/(in+out))), about 0.7. The docstrings said the magnitude was kernel_scale and did not mention the softplus.
  • hyperbolix.__version__, read from the installed package metadata.

Changed

  • Behavior change on Ampere/Hopper GPUs: FGGLinear and FGGConv2D compute their Minkowski product x @ V in full float32 (precision=MATMUL_PRECISION, which is jax.lax.Precision.HIGHEST) instead of following jax_default_matmul_precision, which means TF32 on those cards. Their float32 outputs there change by the TF32 error they used to carry: 2.6e-4 relative on a single FGGLinear, near 1e-3 in the network below. CPU and float64 results are unchanged, and so is a run that already sets jax_default_matmul_precision="highest". The reason is a float64 replay of a trained network: a Procgen PPO agent (BigFish) with an encoder of 15 FGGConv2D and one FGGLinear (c = 0.1, trained on an A100 under the JAX default), 72 checkpoints of 2,048 states each. At the JAX default the greedy action changed 120 times, and in the runs trained without a cap on the feature radius the actor logits were up to 0.14 off float64 (median 2.8e-4 to 1.0e-3). With "highest", which in that network changes only the 16 FGG products, no greedy action changed and the logits were within 1.03e-4. The effect on the return was not measured. Cost on one H100 (float32, one job, three processes per arm, new/old): forward 1.02 for FGGConv2D and for an IMPALA-ResNet of FGG layers at batch 1,024, 1.07 for that network at batch 64; forward plus backward 1.05 to 1.16 for the single layers and 1.09 for the network at batch 1,024. HTCLinear, the FHCNN/FHNN linears, HypLinearPoincare and LorentzConv2D still follow the JAX default. See TF32 on Ampere and Hopper GPUs.

Removed

  • Breaking: LorentzResidual(weight_parameterization="identity"), LorentzResidual.project_w_y() and project_residual_weights(model). The identity mode mirrored the raw learnable w_y of HELM's released code, which gives NaN once w_y < 0, and needed a projection after every optimizer step. A learnable w_y is now always softplus-constrained. Passing weight_parameterization raises a TypeError. The fixed-weight mode, scale_parameterization="exp" and the call-time weight= stay.
  • Breaking: LorentzMoEGate.update_bias(rule=...) and LorentzMoE.update_bias(rule=...). Only DeepSeek-V3's sign rule, the one the HELM paper cites, remains. The removed rule="proportional" mirrored an update_bias that HELM's released training loop never calls.

Fixed

  • HypLinearHyperboloidPLFC, HypConv2DHyperboloidILNN, HypLinearHyperboloidBusemann and HypLinearPoincareBusemann could not be built inside jax.jit or nnx.jit. Their constructor check on v_max ran float(jnp.sinh(v_max)), and inside a jit trace jnp.sinh returns a tracer, so the build raised ConcretizationTypeError. Libraries that build their networks inside a jitted train function hit this. The check now compares v_max with asinh(sqrt(finfo(float32).max)) ≈ 45.05 in plain Python and gives the same verdict eagerly and under jit. A NaN v_max is now rejected; the old check accepted it. Within a few float32 ulps of 45.05 the verdict can differ from the old float32 sinh. A workaround that builds these layers under jax.ensure_compile_time_eval() is no longer needed.
  • Float32 wrapped_normal_hyperboloid.log_prob lost accuracy for a mean far from the origin, without a NaN. It composed logmap with a transport to the origin, and the ambient chart stores log_μ(z) at the mean with components cosh a times its length (a = scaled radius of the mean). It now reads the same vector off the gyro-difference: v = log_0((⊖μ) ⊕ z). Error of the gradient with respect to the mean against float64 (median over 16 directions), z at scaled radius 1, n = 10, c = 0.1: 1.7e-4 → 1.1e-6 at a = 12, 0.64 → 1.3e-6 at 16, 1.8e3 → 2.0e-6 at 20 (scalar σ); 1.1e-3 → 2.2e-7 at a = 10 (diagonal σ). For a mean of tangent norm 1e-4 and z at scaled distance 3: 1.6e-2 → 4.0e-7. For this, log_prob computes close pairs (sinh(θ/2) ≤ 0.5) from z_s − μ_s: median float32 error of the gyro-difference about 4e-4 → 1e-5 at scaled base radius 6–8 for separations 1e-2 to 0.6. The public Hyperboloid.gyro_difference and its callers (the gyro batch norm layers, HoroPCA, the proper-velocity gyro_difference) are unchanged: the close-pair branch cost those layers 1.21× to 1.33× on forward plus backward (CPU), so it is an internal option that only log_prob sets. The log-det term keeps its second derivative at z = μ: jax.hessian of log_prob there was −I/σ² instead of −(1/σ² + (n−1)c/3)·I (hyperboloid at any mean, Poincaré with the mean at the origin). Values change: log_prob by rounding in float64 (≤ 2.9e-15 relative at scaled mean radius ≤ 3) and by the accuracy gained in float32. The raw ambient jax.grad of log_prob, taken with a point's time and spatial slots as independent inputs, changes along the sheet's normal only; chart and Riemannian gradients are unchanged. See Known Limitations.
  • Hyperboloid logmap lost its base-point Jacobian near the origin. For a base point close to the origin and a mapped point further than √c·d ≈ 0.96 away, the float32 Jacobian with respect to the base point had a relative error of about 1 to 5 times eps/(√c‖x_s‖): medians of 3e-4 to 5e-4 at √c‖x_s‖ = 3e-4 and 3e-2 to 8e-2 at 3e-6 (c = 0.1, √c·d = 3), and above 1 at 1e-7. Float64 lost the same factor at its own eps. The value and the Jacobian with respect to the mapped point were at rounding level, so nothing showed in a forward check. The polar-frame assembly built this Jacobian from three terms of size d/‖x_s‖ that cancel. A base point with √c‖x_s‖ ≤ 0.1 now takes the displacement form (y_s − x_s) − 2S²·x_s that close pairs already used, at every separation, and its Jacobian is within 1e-6 down to ‖x_s‖ = 1e-15. Outside that neighbourhood the code path is unchanged: the base-point Jacobian is up to 9e-6 off just outside it and improves like 1/‖x_s‖. Values change by a few ulp for a base point inside the neighbourhood. One exception: for a nonzero base point closer to the origin than MIN_NORM = 1e-15, the value for a far pair was off by half and is now right, while the Jacobian with respect to a point that close to the origin stays unreliable. See Origin derivatives. The gradient of the wrapped normal's log_prob with respect to a near-origin mean went through this Jacobian until log_prob moved to gyro_difference (the log_prob entry above).
  • Hyperboloid and proper-velocity expmap lost their base-point Jacobian near the origin, and tangent_norm/tangent_inner their base-point gradient. The geodesic length came from the radial/perpendicular split of the tangent vector, which divides by ‖x_s‖; its gradient with respect to a base point near the origin carried an absolute error of about eps/(√c‖x_s‖) of its natural scale. expmap inherited it: for a step of scaled length 10 the float32 Jacobian with respect to the base point was off by 7e-4 at √c‖x_s‖ = 1e-3, 4e-2 at 1e-5 and above 1 at 1e-7, with a correct value. A base point with √c‖x_s‖ ≤ 0.1 now takes the Cartesian form of the transport to the origin, and the expmap Jacobian is within about 1e-6. The reparameterized wrapped_normal_hyperboloid.sample calls this expmap at the mean: with σ = 1 its float32 Jacobian with respect to the mean was off by up to 9e-4 at scaled mean radius 1e-4 and 1e-2 at 1e-5, and is now within 1e-6. Values change by rounding for a base point inside the neighbourhood, with one exception: for a nonzero base point just below MIN_NORM = 1e-15 the three functions returned values off by up to 30 % and are now right. The raw gradient with respect to the ambient point changes along the sheet's normal only. See Origin derivatives.
  • A float64 c promoted the output of float32 manifolds to float64 under x64. Manifold methods cast the points to the manifold's dtype but passed c through raw, so float32 points with a float64 0-d c gave float64 from, for example, Hyperboloid.logmap, tangent_norm, tangent_inner and ProperVelocity.expmap. Every method of Hyperboloid, Poincare, ProperVelocity, Klein, HalfSpace, Stereographic and Euclidean now casts c to the manifold's dtype (ManifoldBase._cast_c), so output and computation dtype follow the manifold. Values do not change for a float32 manifold with a Python-float c (bitwise equal on all 320 method/c cells measured); only the output dtype changes where c was a float64 array.

Documentation

  • The HELM layers (LorentzMLA, LorentzMoE, LorentzMoEGate, LorentzSwiGLU, LorentzResidual) are described as the HELM paper's form, not as reproductions of HELM's released code. Their docstrings list the differences from that code. LorentzResidual matches HELM's LResNet in the forward pass for w_y >= 0; its input gradients differ along the hyperboloid normal only.
  • Corrected the float32 limit of the hyperplane MLR heads in the numerical stability guide. Near a hyperplane the logit is off by about eps·e^(a+|ρ|)/4: 1e-3 at a + |ρ| ≈ 10.4, 1e-2 at 12.7 and 0.1 at 15.0. Off the hyperplane the relative error of the gradient is about |tanh δ| times that, with δ the scaled distance to the hyperplane. The earlier rule of thumb (0.1 % at a + ρ ≈ 15) was the median gradient error exactly on the hyperplane, where the first-order term vanishes. A float64 head removes the offset's share only if the time coordinate is also rebuilt in float64 from the spatial part.

1.4.0 - 2026-10-01

Two new models, Klein and HalfSpace. Far-pair Poincaré and Stereographic operations are now cancellation-free, and the Poincaré and Busemann layers score tangent input in closed form. LearnableCurvature's clamp keeps the gradient that points back inside, and non-finite input now stays non-finite instead of turning into a plausible finite output. The HELM decoder layers (LorentzMLA, LorentzMoE, LorentzEmbedding) are new. Full numbers and mechanisms are in the numerical stability guide.

Added

  • Klein manifold (hyperbolix.manifolds.Klein), the Beltrami–Klein ball model (Mao et al. 2024; Zhang et al. 2026). It implements the scalar-c Manifold protocol plus gyro_difference, lorentz_factor and einstein_midpoint. dist has one formulation (version_idx is ignored) and is cancellation-free: median float32 relative error 1.19e-05 at scaled radius a = 4, against 4.33e-02 for Eq. 4 of Zhang et al. The chart holds half the Poincaré radius (a = 6.32 float32 / 13.86 float64 at c = 1). Klein.expmap keeps the factor c that the reference _klein_expmap omits; the two agree only at c = 1. See Klein.
  • HalfSpace manifold (hyperbolix.manifolds.HalfSpace), the Poincaré upper half-space model with HTorch's convention: the height x_n > 0 is the last coordinate, origin e_n/√c. It implements the scalar-c Manifold protocol, and its pairwise operations are cancellation-free. They return inf/NaN past √c·d ≈ 88.7 in float32 (709.8 in float64). HTorch's ptransp is not an isometry, and HalfSpace does not reproduce it. See Half-Space.
  • Isometry maps for Klein and HalfSpace (hyperbolix.manifolds.isometry_mappings): klein_to_* / *_to_klein for Poincaré, Hyperboloid and PV, and halfspace_to_* / *_to_halfspace for Poincaré (the Cayley transform), Hyperboloid, Klein and PV. None of them projects its output. A far point mapped into Klein can land between the proj margin and the boundary, so call Klein.proj after mapping far points in. See The Chart Ceiling and Floor.
  • HoroPCA and CoSNE accept ProperVelocity, Klein and HalfSpace input. Each model is mapped by its isometry onto the hyperboloid (HoroPCA) or the Poincaré ball (CO-SNE), and results come back in the input's model. Poincaré and Hyperboloid results are bit-identical through the new routing (88/88 arrays); HoroPCA's centering changed separately (see Fixed).
  • HELM layers (hyperbolix.nn_layers; He et al. 2025, arXiv:2505.24722).
    • LorentzMLA, multi-head latent attention. Keys and values are decompressed from one low-rank latent point per token, a decoupled slice of the queries and keys is rotated by HOPE, and the score is the negative squared Lorentzian distance over a learned temperature tau = exp(log_tau). Causal, segment (segment_ids) and padding (attention_mask) masks; only HELM's q_lora_rank = 0 path. centroid_form="gemm" is the default, as in HELM's code; "variance" is for short sequences or values far from the origin. See the attention score floor.
    • LorentzEmbedding and lorentz_embedding_init, the hyperboloid token embedding: a ManifoldParam table on Hyperboloid (parameterization="manifold", the default, trained with riemannian_adam) or a Euclidean table of spatial coordinates ("spatial"). c_out maps the looked-up points onto another sheet.
    • LorentzMoE, LorentzMoEGate, LorentzSwiGLU, moe_sequence_balance_loss, MoERoutingStats and RoutingBias: the mixture of curvature experts in the form of the paper, not of the released code. Top-k routing; each routed expert is a LorentzSwiGLU on its own sheet, with a LearnableCurvature starting at linspace(0.1, 2.0, E); routed and shared outputs are merged by one Lorentz centroid. Load balancing is DeepSeek-V3's auxiliary-loss-free bias (LorentzMoEGate.update_bias / LorentzMoE.update_bias, which write the RoutingBias variable) plus the sequence-wise moe_sequence_balance_loss. expert_curvatures=[1.0] * E, learnable_curvature=False matches the released 120M checkpoint. The experts run densely (E / top_k times the work of a sparse dispatch), which is fine for small E.
  • Opt-in building blocks for HELM-style blocks; defaults are unchanged. hope_rotate_space; HTCLinear(return_space=True) and HRCRMSNorm(space_only=True); positions broadcastable against z.shape[:-1] in hope/HyperbolicRoPE; per-token weights in lorentz_residual/LorentzResidual, plus LorentzResidual(weight_parameterization="identity", scale_parameterization="exp") and a call-time weight= (with "identity" a trainable w_y can go negative, which gives NaN where the combination turns spacelike; see the lorentz_residual entry under Changed); lorentz_midpoint(form="gemm") and HyperbolicFullAttention(centroid_form="gemm"), the single-GEMM centroid (default "variance" unchanged bit for bit).
  • project_residual_weights(model) and LorentzResidual.project_w_y(), projected gradient descent for the identity-mode (HELM) w_y: called after optimizer.update, they set every identity-mode w_y to max(w_y, 0), the domain of LResNet's Lemma 4.1, so a trained w_y cannot turn the combination spacelike (NaN). Softplus-mode and fixed weights are untouched.
  • hyperbolix.utils.math_utils.asinh, exported from hyperbolix.utils: jnp.arcsinh with an overflow-safe derivative. See the asinh/acosh entry under Fixed.
  • hyperbolix.utils.AUTO / Auto, the default of c_min/c_max in LearnableCurvature and LorentzMoE ("resolve from the parameterization"; None still disables a bound). They replace the private _AUTO/_Auto.

Changed

  • Breaking: LearnableCurvature's clamp keeps inward gradients, straight_through_clamp is removed, and the default softplus/log bounds are [init_c / 10, init_c * 10]. The forward value is still c clipped to [c_min, c_max]. On or outside a bound, the backward now passes only a gradient that moves c back inside: projected gradient descent inside the forward pass, with no extra call in the train step. The old clamp pinned c at a bound for the rest of the run once a step crossed it. In float32 this froze LearnableCurvature(init_c=0.1) under the default log from step 0 (since 1.3.0). Bounds are unchanged at init_c=1.0; identity keeps [-10, 10]. Passing straight_through_clamp raises a TypeError, and so do jax.jvp/jax.jacfwd through a clamped instance (custom VJP; reverse mode and jax.hessian work). See Choosing a parameterization.
  • Behavior change: ProperVelocityGyroBatchNorm's batch mean is the Lorentz centroid of the hyperboloid lift, as in HyperboloidGyroBatchNorm, instead of the log-Euclidean mean. The log-Euclidean mean does not commute with the centering, so the output's Fréchet mean missed the bias point: by 0.73 for a batch centered at radius 2 (float64, c = 1), against 8.2e-3 now. Train-mode outputs change for off-origin batches.
  • Behavior change: non-finite input stays non-finite. ProperVelocity.proj is now the identity (it used to apply jnp.nan_to_num), so the PV norm layers keep non-finite rows. HypLinearPV/HypConv2DPV pass a non-finite MLR score through instead of saturating it at the sinh clip. sinh_lift_to_hyperboloid (the end of HypLinearHyperboloidPLFC, HypConv2DHyperboloidILNN and HypLinearHyperboloidBusemann) no longer clips a non-finite score to ±v_max, which gave a finite loss (12.6 to 13.8) with 4096 of 4096 NaN kernel gradients; the loss now goes NaN at the onset minibatch. HypLinearPoincareBusemann likewise no longer clips an inf logit (e.g. a log_scale past float32 exp overflow) to ±v_max; the row is NaN. In float32, uniform_poincare.sample with n = 2 returns inf radii past √c·R ≈ 89.42. Finite rows are unchanged. See Input Overflow.
  • Behavior change: frechet_mean divides the Karcher step by mean_i(a_i·coth a_i), a_i = √c·d(x_i, μ), and step_size is a multiplier on that step. The fixed step overshot once the batch spread past √c·d ≈ 2: over 60 Hyperboloid/PV cells (float64) it left 24 unconverged after 100 iterations, the new step none (worst residual 4.03e-11). The iterates change whenever a point is away from the current mean.
  • Behavior change: the Poincaré HNN++ layers and all four Busemann layers score tangent input in closed form instead of lifting it with expmap_0 onto a stored point. This covers HypRegressionPoincarePP/HypLinearPoincarePP with input_space="tangent", HypConv2DPoincare, and the Poincaré and Hyperboloid Busemann layers with input_space="tangent". At t = √c‖v‖ = 8, the float32 regression-score error drops from 2.04e-1 to 1.47e-6. At small t the float32 kernel gradient of the Hyperboloid Busemann layers grows like 1/t, as on the Poincaré side. The Hyperboloid Busemann layers now require _busemann_tangent. See Tangent Inputs.
  • Behavior change: the FHCNN/FHNN scale and the Busemann layers' alpha use plain exp. A runaway scale parameter now overflows to inf (float32 past ln(FLT_MAX) ≈ 88.72) and the loss goes NaN at that step, instead of saturating at exp(87.8) through capped_exp with an exactly zero gradient. capped_exp stays exported; the layers no longer use it.
  • Behavior change: lorentz_residual normalizes by sqrt(-c<ave, ave>_L), without abs() or the eps floor. Unchanged for w_y >= 0: there -c<ave, ave>_L >= (1 + w_y)^2, and the output is bit-identical (0 of 27040 probe pairs differ). A negative weight (w_y = -1, or LorentzResidual(weight_parameterization="identity") trained below 0) that makes the combination spacelike now gives NaN instead of the finite point the HELM/LResNet reference's .abs() returns. A past-directed combination (w_y < -1) still comes back as a finite upper-sheet point.
  • Breaking: HyperbolicFullAttention stores its temperature as log_tau (τ = exp(log_tau), always positive), starting at Hypformer's τ = √out_features (new init_tau). An optimizer step could drive the old raw scale to 0 or below, and a negative value makes the softmax prefer the farthest keys. Scores are (2/c + 2⟨Q,K⟩_L)/τ. scale and attn_bias are gone, so old checkpoints do not load; init_tau=1.0 gives the old attention at init.
  • Behavior change: HyperbolicLinearAttention divides its kernel ratio by the denominator floored at the smallest normal number, not by den + eps (Hypformer: + 1e-6). A query whose spatial part is ≤ 0 on a head used to get ≈ 0 from that head, and now gets its attention average. At head dim 4 this hit 2 of 4 random seeds, with errors of 0.74 to 0.81. Elsewhere outputs move by about eps/den.
  • Behavior change: the attention layers keep bfloat16/float16 in and out, and run their softmax in float32. HyperbolicFullAttention and HyperbolicSoftmaxAttention compute the softmax (mask fill -1e18) in at least float32, as LorentzMLA does. HyperbolicLinearAttention and HyperbolicSoftmaxAttention no longer return float32 for bfloat16/float16 input. float32 and float64 results are bit for bit unchanged.
  • Poincaré dist slot 2 (VERSION_METRIC_TENSOR) now runs slot 0's function. Both evaluate the same asinh form; slots 0 and 2 are now bitwise equal in value and gradient. See Slot 2.
  • Cost of the Poincaré fixes. On CPU most rewritten operations and layers got faster (slot 0 dist forward+backward 0.292–0.335× the old time). The slowest is ptransp, 1.112–1.117× forward on CPU; on the A100 its forward is not resolved (1.120, 1.199, re-time 0.984) against identical-code runs up to 1.113. These timings predate the Busemann tangent scores, the sampler fallback and the half floors.

Removed

  • LearnableCurvature(straight_through_clamp=...); passing it raises a TypeError (see the clamp entry under Changed). The private Poincare._dist_metric_tensor is removed as well.
  • HyperbolicFullAttention.attn_bias and HyperbolicLinearAttention.temperature, two parameters without effect, which Hypformer also has. The bias adds one constant to a row of scores, so it cancels in the softmax. The temperature scales φ(Q) and φ(K) alike, so it cancels in the kernel ratio except through the eps floors; its gradient was 5 to 6 orders of magnitude below every other parameter's. The linear layer keeps the old value t = 1, so its outputs at init are unchanged. focus_transform keeps its signature.

Fixed

  • Poincaré dist and logmap were wrong for far pairs in float32. They now use asinh(√c‖x − y‖/√(B_x·B_y)) instead of atanh(√c‖(-x) ⊕ y‖), whose argument rounds towards 1. Two points at scaled radius 7.2 on opposite sides (true distance 14.4, c = 1): dist 14.332947 with an exactly zero gradient → 14.400112. ptransp (the gyration, regrouped in s = x + y) and apollonian_dist no longer cancel near the boundary. Values change for every pair, by ≤ 1.3e-13 in float64. Slot 1 (VERSION_MOBIUS) is unchanged and still saturates. See Far pairs.
  • Stereographic dist, logmap and geodesic saturated on far pairs at c > 0 in float32. They now use the same asinh identity as Poincare. At the same far pair (true distance 14.4): dist 12.656 → 14.39999. Values change for every pair at c > 0; at c ≤ 0, logmap and geodesic are bit-identical and dist moves by ≤ 3.1e-7 relative (float32). See Far pairs.
  • Divisor floors zeroed gradients at capped points. Poincaré divisors 1 − c‖x‖² were floored at their value at the proj cap, which the computed value of 11–76 % of capped points falls below. The floor is now half that value, which none of the measured capped points reaches at c ∈ {0.1, 0.3, 1, 2.5} (very small c can reach it; see the guide). Klein's g_x and the isometry maps use the same half floor. Float32 tangent_norm gradient error at capped points: 1.0 → 3.7e-2. Float32 expmap and ⊕ gradients at capped points stay wrong, for other reasons. See Divisor Floors.
  • Float32 overflow collapsed Poincaré rows to the origin with a zero gradient. HypLinearPoincarePP and HypConv2DPoincare collapsed once an HNN++ score reached √c·v ≈ 44 (43.9 at c = 0.1, 45.05 at c = 1); HypLinearPoincareBusemann once O·sinh²(v_max)/c > FLT_MAX. All three now share a lift that rescales each row by a power of two, so a saturated row lands at the ball's edge (√c·‖y‖ 0.99999994 against 0 before). Below the old threshold, values move by a few ulp. Remaining sites: Silent overflow.
  • JAX's asinh/acosh derivatives overflowed. Their JVP rules square the argument, so the float32 derivative is exactly 0.0 for |x| > 1.84e19 although the true value is representable. Every library asinh call site now uses the new math_utils.asinh wrapper (tangent 1/hypot(1, x)), and the acosh wrapper's tangent became 1/(√(x−1)·√(x+1)). The hyperboloid MLR score reached this regime: at bias r = 60 its bias and input gradients were exactly zero. Reported upstream as jax-ml/jax#40634. See asinh and acosh.
  • Hyperboloid-side cancellations. wrapped_normal_hyperboloid.log_prob transports to the origin with a private transport instead of Hyperboloid.ptransp's Cartesian branch. The FHNN linear and conv layers read the output's spatial norm off the height m directly. HoroPCA centers with Hyperboloid.gyro_difference instead of the Lorentz boost matrix: at scaled radius 8, float32 transform error 0.377 → 1.66e-4 nats. Values change whenever center_data=True; boost_ is still fitted, but transform now reads mean_.
  • uniform_poincare.sample put samples outside small balls in float32, and its n ≥ 3 rejection loop could hang. Both directions of the radius map are now evaluated in half-angle form: at √c·R = 1e-3 samples used to land up to 1.5441·R out, and now none does. Where the loop cannot accept a sample, the radius is drawn in closed form. Elsewhere the samples are bitwise unchanged. For the float32 n = 2 change at large radius, see the non-finite entry under Changed.
  • Softplus inits above 20 were not recovered exactly in float64. _inv_softplus returned x instead of x + log1p(−exp(−x)) for x > 20, so LearnableCurvature(init_c=20.5, parameterization="softplus") with param_dtype=jnp.float64 came back 351887 ulp high. The inverse is now exact (0 ulp in both dtypes). LorentzResidual's softplus init_w_y/init_gamma share the fixed inverse.
  • The Busemann layers accepted the other model's manifold. Poincare and Hyperboloid both have busemann and _busemann_tangent, so the method-name check let each into the other model's layers. Such a pair usually failed at the first call with a shape error, but at in_dim = 2 some calls ran without an error. All four Busemann layers now check the class and raise a TypeError at construction. The other models (Klein, HalfSpace, Stereographic, ProperVelocity, Euclidean) were already rejected. See Tangent Inputs.
  • hope and HyperbolicRoPE rounded the positions to bfloat16 on bfloat16/float16 input, so between 512 and 1024 a position was rounded to a multiple of 4. The rotation now runs in promote_types(dtype, float32), as HELM does; float32 and float64 input are unchanged. Worst rotation error of a bfloat16 input at S = 1000: 4.67 → 0.028.

Documentation

  • New sections in the numerical stability guide: the MLR score at a large hyperplane offset (a half-angle rewrite was measured and not adopted, at 1.9–2.5× forward+backward cost on HypRegressionHyperboloid), input overflow, where float32 overflow still collapses silently, the divisor floors and the tangent-input paths. The Poincaré precision table now holds measured float32 errors, and the chart ceiling is stated per curvature (12.65 / 27.73 at c = 1). The hybrid examples pass Euclidean features with input_space="tangent".
  • Corrected docs and docstrings: the gyro_difference/ptransp chart rule (the Cartesian chart applies whenever either endpoint's scaled spatial radius is at most 1e-1, not only at the origin); an accuracy warning on Hyperboloid.minkowski_inner; _assert_v_max_safe, which bounds one entry only (v_max ≲ 45.05); and the tangent-projection residual in _egrad2rgrad/_tangent_proj.
  • The HELM citation named the wrong paper ("Chen et al. 2024, Hyperbolic Embeddings for Learning on Manifolds"); it is He et al. 2025, "HELM: Hyperbolic Large Language Models via Mixture-of-Curvature Experts" (arXiv:2505.24722). The LResNet entry in the layers API index now cites He, Yang & Ying (2025), "Lorentzian Residual Neural Networks" (KDD 2025).
  • riemannian_adam's docstring explains why it has no geoopt-style stabilize option: every step already ends on the manifold, and re-projecting the moment only loses float32 accuracy far from the origin.
  • User guide and API pages checked against the code: broken examples fixed (e.g. nnx.jit train steps), stale advice removed, numerical-stability.md trimmed to user guidance.

1.3.0 - 2026-09-09

Changed

  • LearnableCurvature's default parameterization is now "log" (was "softplus"). The softplus docstring's attribution to "the van Spengler et al. 2023 Poincare ResNet convention" didn't hold up: that paper's own reported curvature experiments (Sec. 4.2) sweep fixed values c ∈ {1, 0.1, 0.01} and settle on c=0.1, not a learnable softplus-reparameterized curvature — the softplus(raw) mechanism itself is geoopt's Stereographic/PoincareBall convention, which the released Poincare ResNet code happens to default to (learnable=True) since its manifold is built on geoopt. "softplus" remains available and its docstring now cites geoopt with the code-default note. Breaking for call sites relying on the implicit default — pass parameterization="softplus" explicitly to keep the old behavior

Fixed

  • Origin derivatives now follow the on-manifold Cartesian chart instead of value-only polar fallbacks. Hyperboloid.gyro_difference and ptransp use exact Cartesian formulae when either endpoint's scaled spatial radius is at most 1e-1 and keep the stable polar frame otherwise. Hyperboloid.logmap uses the regular Cartesian expression at an exact origin endpoint and the stable polar frame otherwise; ordinary autodiff follows the selected expression. busemann now evaluates a projected-coordinate branch whose constrained first derivative agrees across q = <x_s,v> = 0, restoring the origin gradient -v for a unit direction. lorentz_midpoint now uses the time/velocity variance form below, preserving the derivative of a nonzero-weight origin point in a mixed cloud. The inherited log-map origin defect predates the preceding polar-frame sweep; that sweep repaired large-radius and collinear behavior without covering every origin endpoint derivative. ProperVelocity.logmap, gyro_difference, and ptransp inherit these repairs through their exact hyperboloid lifts. Public signatures, defaults, and version slots are unchanged.
  • Signed Möbius operations now have the literal curvature derivative at c = 0 for nonzero operands. The stable denominator evaluates separate signed factorizations for c > 0 and c <= 0; both match 1 + 2*sign*c*<x,y> + c^2*||x||^2*||y||^2 and its slope at zero. The existing MIN_NORM radial floors leave only their bounded residual when an operand is exactly zero. The preceding abs(c) factorization selected the wrong one-sided denominator slope at zero, so a signed learnable curvature could receive the wrong update on its flat step.
  • Historical scope of the preceding numerics sweep. The large-radius "rest of the Hyperboloid" entry and the _logmap_direction entry below describe the value and collinear-gradient repairs measured before this origin-derivative pass. Their measurements are preserved as historical evidence; they do not claim that every origin endpoint derivative was already correct. The first Fixed entry records the current origin behavior.
  • Historical value repair from the preceding numerics sweep: the rest of the Hyperboloid's two-point and tangent-space primitives cancelled the same way dist/logmap/sqdist/tangent_norm did before this file's earlier fix: expmap (two-point form), ptransp/ptransp_0, tangent_proj, tangent_inner, egrad2rgrad, the gyro addition (the Lorentz boost, feeding HypLinearHyperboloidPLFC's and friends' gyro-bias), and busemann all formed an O(1) result as the difference of two O(e^{2a}) Minkowski terms, a = √c·d the scaled geodesic radius. At that revision each read the radius off the spatial part and subtracted before squaring, via the shared radial_perp_decomposition helper in hyperbolix/utils/math_utils.py. Not bit-identical: forward values are unchanged up to rounding below the cancellation's onset, and gradients differ from step 0 at rounding level. Measured (4-seed medians, float32, logs/2026-09-08_hyperboloid_tangent_primitives/): gyro-addition forward geodesic error 4.181e-04 → 1.366e-05 at a=6, 1.527e-02 → 9.767e-05 at a=8, 6.557e-02 → 6.802e-04 at a=10 (5 of 32 seeds non-finite as-is, 0 fixed); end-to-end riemannian_adam on a ManifoldParam loses both seeds to NaN by a=9 as-is, fixed stays finite through a=16; the transport isometry |ratio-1| goes from non-finite on 1-2 of 4 seeds from a=9 on (max residual 6.6e+14 at a=10) to 1.192e-07 / 1.132e-06 / 7.557e-05 at a=6/8/12; egrad2rgrad relative error 3.816e-05 → 4.616e-08 at a=6, 1.000e+00 (2 of 4 seeds non-finite) → 1.005e-07 at a=14 — it needs no division by a measured quantity at all now, since ⟨x,x⟩_L = -1/c holds exactly on the sheet, so the 1.2.0 claim that the Riemannian gradient is unchanged after egrad2rgrad now holds by construction rather than by cancellation luck; the aligned-branch busemann relative error 1.096e-02 → 1.585e-09 at a=8, 1.878e+00 → 2.274e-06 at a=12 (as-is pins 1 of 4 seeds on the -34.5 MIN_NORM floor at a=10 and 3 of 4 at a=12, with an identically-zero gradient at a=12; fixed pins none at either radius). expmap's landing accuracy is the one cell that is not a clean win: at a=14 the fixed geodesic landing error is worse than as-is, 3.500e-02 vs 2.410e-02 median (1.45x) — see docs/user-guide/numerical-stability.md for the full table.
  • The Poincaré/κ-stereographic Möbius denominator 1 ± 2c⟨x,y⟩ + c²‖x‖²‖y‖², behind dist, logmap, addition, and gyr, no longer forms the cancellation at the ball chart's ceiling. It evaluates separate signed factorizations built from the radial gap and sum, so subtraction happens before squaring and the literal curvature slope is retained at c = 0 for nonzero operands. The measurements in probe_poincare_mobius_ebebd09.out describe the earlier positive-curvature value repair and remain historical evidence; the signed zero-curvature derivative repair is covered separately above.
  • lorentz_midpoint now uses a time/velocity variance for both its large-radius value and its origin-point derivative. With h = sum_m w_m*x_m, t_m = x[m,0], z_m = x[m,1:]/t_m, T = h[0], and z_bar = h[1:]/T, the normalizer is D^2 = T*sum_m w_m*(1/t_m + c*t_m*||z_m-z_bar||^2) = c*(T^2-||h_s||^2). The direct variance avoids the cancelling Lorentz square and divides only by positive time coordinates, so a nonzero-weight origin point retains its derivative in a mixed cloud. Weights must be non-negative. An all-zero weight row still returns the origin as a value convention; no weight derivative is promised there. Historical measurements of the preceding radius/direction variance form remain documented as historical evidence in the numerical-stability guide.
  • ProperVelocity operations now share one direct hyperboloid bridge. expmap and gyro addition use the bridge introduced at 8e77147; gyro_difference and ptransp joined it at 757a910, and ProperVelocityGyroBatchNorm now centers with gyro_difference. A tangent lifts as (<x,v>/X_0, v) at X = (sqrt(1/c+||x||^2), x), and the PV result is the spatial part of the hyperboloid result. The bridge avoids the Poincaré chart and carries the repaired Cartesian origin derivatives into PV.
  • HoroPCA's horo_projection and ProperVelocity's tangent_inner/tangent_norm inherited the same cancellation, through busemann and radial_perp_decomposition respectively. Measured (probe_midpoint_horopca_busemann_pv_9093ea7.out, 4-seed medians, a = √c·d): horo_projection error (K=2 ideal directions, vs the library's own float64 path, table C.ii) 1.413e-01 → 1.086e-04 at a=8, 3.660e+00 → 8.633e-03 at a=12; Busemann-coordinate preservation |dB| 8.170e-02 → 8.836e-05 at a=8. ProperVelocity |⟨v,v⟩-1| on the exactly-unit radial tangent (table C.iv) 6.250e-01 → 2.384e-07 at a=8, 1.536e+03 → 5.192e-05 at a=12.
  • HyperboloidGyroBatchNorm's centering step, (⊖x) ⊕ y with the batch mean close to x, cancelled in the general ambient boost. It now centers with Hyperboloid.gyro_difference(x, y, c) (see ### Added below). That operation uses the Cartesian inverse boost when either endpoint's scaled spatial radius is at most 1e-1 and the stable polar frame otherwise. Historical high-radius value and first-derivative measurements in step2c_gyro_difference_accuracy.out and step2c_gyro_bn_centering.out predate the Cartesian origin repair; they do not describe the current origin derivative rule. This retires Known limit 1 of docs/user-guide/numerical-stability.md.
  • ProperVelocity.dist/.logmap between nearby points at large radius cancelled the same way the ambient hyperboloid two-point primitives did before their own fix, since PV's tangent-space metric routes through the same Minkowski forms. Both now go through the exact lift X = (√(1/c+‖x‖²), x) onto the hyperboloid and its cancellation-free polar-frame dist/logmap. Measured (step2c_pv_accuracy.out, c=0.5, dim 16, radial step of true Riemannian length 0.1, landing point in float64, coordinate-axis direction): old dist 5.988811e-02 / 4.382994e+00 / 1.056287e+01 at a=8/10/12 (true value 0.1), new relative error 9.54e-07 / 8.05e-07 / 4.62e-07 — inside the float32 storage floor of the same pairs, 9.24e-07 / 7.22e-07 / 4.92e-07. This is the favourable direction: on the same probe's PRNGKey(3) direction, the worst new relative error over a ∈ {8,10} is 1.13e-04 at a=10, against that pair's own storage floor of 1.41e-05. The full float32 chain (expmap in float32 too) used to return 3.167524e-01 at a=8 and 4.369660e+00 at a=10 for a true step of 0.1; it now returns 1.000014e-01 and 9.999371e-02. Equivalence (step2c_pv_equivalence.out): float64 new vs old at a≤3 agree to 8.09e-14 max; against an 80-bit reference at a≤6, dist is 7.11e-15 max against old's 3.64e-11, and logmap is 4.39e-14 max relative error / 1.26e-12 max ‖err‖_x; dist(x,x) and logmap(x,x) are exactly 0 in both dtypes with a finite gradient there. Callers that inherit the fix unchanged: utils.helpers.compute_pairwise_distances, decomposition/frechet.py, nn_layers/poincare_batchnorm.py (with a PV manifold), manifolds/product.py. This retires Known limit 4 of docs/user-guide/numerical-stability.md.
  • Historical collinear-gradient repair from the preceding numerics sweep: _logmap_direction, the helper shared by Hyperboloid.logmap, .ptransp, .gyro_difference and, through the exact lift, ProperVelocity.logmap, normalized a vector that is exactly zero on the whole collinear set, leaving an O(1) gradient error there while the forward value stayed correct. It returned (cos φ, sin φ, n̂) with n̂ = safe_normalize(ŷ_s − ⟨x̂_s, ŷ_s⟩·x̂_s); on a pair sharing a ray (ψ = 0 or π, y = x included) that argument is zero up to rounding, so the normalization's derivative is arbitrary, and multiplied by a sin φ that is itself only O(rounding) rather than exactly 0, it left an O(1) error in the gradient. Pre-existing since the polar-frame logmap of 1.1.2 (2026-08-25). At that revision the helper returned (S·cos φ, perp_y) with no 1/S and no 1/‖perp_y‖ anywhere: perp_y = r_y·[(csum²/4)·(ŷ_s − x̂_s) + (chord²/4)·(x̂_s + ŷ_s)], a non-negative combination of two orthogonal vectors that vanishes exactly on both degenerate rays, and each consumer's own prefactor cancels the remaining S (log_x(y) = asinhc(S)·(2/√c)·(S·cos φ)·e_rad + (asinhc(S)/C)·(0, perp_y); similarly for ptransp and gyro_difference — see the docstrings for the exact scales). Measured (step2e_gradients.out, a ≤ 3, old → new): float64 ∇‖log‖²/∇⟨w,log⟩ on collinear/y = x pairs 2.81 → 1.8e-10; the Jacobian of log_x(·) at y = x vs the identity 1.00 → 5.0e-16; ptransp's ∇⟨w, PT v⟩ f32-vs-f64 relative error 3.29 → 4.0e-6; gyro_difference's gradient f32-vs-f64 relative error 5.94 → 9.6e-7; PV ∇‖log‖² on a collinear pair, float32, 4.1e-5 → 2.2e-5 (1.9x better than even the pre-lift ambient PV spelling; float64 unchanged at 3.3e-10 either way). Zero non-finite entries across every geometry and dtype. Forward values are unaffected: float64 new-vs-old equivalence at a ≤ 6 over dims 2/5/64, c ∈ {0.1, 0.5, 1, 3}, 5 geometries, 5 seeds (step2e_equivalence.out) — logmap 4.7e-16, ptransp 5.8e-14, gyro_difference 3.2e-15, PV logmap 1.5e-15 (budget 1e-12); dist/sqdist/_polar_frame are bitwise unchanged; float32 _logmap at a ∈ {9, 12} worst 1.7e-7 against 2.3e-7 old. New test test_hyperboloid_logmap_squared_norm_gradient_is_exact_on_the_collinear_set measures 3.8e-15 (float64) / 1.4e-6 (float32) against bounds 2e-14 / 6e-6; the old code gives 6.3e-1 / 1.1 on the same grid (step2e_test_bounds.out). _gyro_difference also then built its time slot with _time_slot directly instead of _proj(concatenate([0, s])) — bit-identical value and gradient over 2880 pairs, both dtypes (step2e_time_slot.out), the same GPU fusion-shape reason as the _addition entry below.

Changed

  • is_in_manifold/is_in_tangent_space now test the residual on the time slot instead of the Lorentz form. The old check compared ⟨x,x⟩_L against -1/c (or ⟨v,x⟩_L against 0), a residual that grows like 2·x₀ times the honest time-slot discrepancy and is itself obtained as a difference of two O(cosh²a) numbers. Comparing x₀ (or v₀) against √(1/c + ‖x_s‖²) directly removes both factors: an explicit atol now bounds |x₀ - √(1/c + ‖x_s‖²)|, where it previously bounded roughly 2·x₀ times that quantity.
  • lorentz_midpoint's normalizer is O(N·M·D) — one (…, N, M, D) broadcast difference, not a pairwise (…, M, M, D) Gram. The O(M²) key-Gram form never shipped in a release: on this branch it existed only between the accuracy fix and the variance-form rewrite that replaced it (see the ### Fixed entry above). Cost: see the next entry.
  • Historical cost of the preceding sweep at 5b756df against b586169 (as-is) — AOT-compiled executables, float32, batch 4096, c = 0.5, spatial radius ≈ 3, forward and nnx.value_and_grad forward+backward; CPU is XLA:CPU on the development box, GPU an A100 with XLA_FLAGS=--xla_gpu_autotune_level=0 (logs/2026-09-08_hyperboloid_tangent_primitives/cost_summary.md, probe_cost_{b586169,5b756df}.out, probe_cost_gpu_{b586169,5b756df}.out). The rows are workload functions, plus the explicitly named single optimizer step; they are not complete training-update, current-performance, or convergence measurements. They predate 757a910 and the origin-derivative repairs.

    workload CPU as-is ms CPU new ms CPU ratio GPU as-is ms GPU new ms GPU ratio
    PLFC gyro-bias fwd 6.2048 2.2965 0.370 0.2561 0.2510 0.980
    PLFC gyro-bias fwd+bwd 13.8245 6.3049 0.456 0.6084 0.6258 1.03
    GyroBatchNorm(train) fwd 9.0924 5.5412 0.609 0.5463 0.4806 0.880
    GyroBatchNorm(train) fwd+bwd 13.4201 7.6611 0.571 0.7203 0.5613 0.779
    HyperboloidGyroRMSNorm fwd+bwd 3.5352 3.5132 0.994 — — —
    HyperbolicFullAttention fwd 12.0482 89.9417 7.47 0.6080 0.9836 1.62
    HyperbolicFullAttention fwd+bwd 31.1128 139.1628 4.47 1.4532 2.1561 1.48
    LorentzResidual fwd 0.8921 2.0828 2.33 — — —
    LorentzResidual fwd+bwd 1.7535 3.0969 1.77 — — —
    Busemann head fwd 2.1609 98.2874 45.5 — — —
    Busemann head fwd+bwd 4.4315 131.7908 29.7 — — —
    _busemann_score K=256 fwd+bwd — — — 0.3418 0.8373 2.45
    _busemann_score K=1000 fwd+bwd — — — 0.5406 2.3974 4.43
    riemannian_adam one step 21.2513 21.7737 1.02 — — —
    Poincare.dist (vmap) 5.2551 2.1213 0.404 — — —
    Poincare.addition (vmap) 4.5814 5.3327 1.16 — — —
    Poincare.logmap (vmap) 8.5312 7.9924 0.937 — — —
    HypLinearPoincarePP fwd 3.4088 3.3689 0.988 — — —
    HypLinearPV fwd 1.3097 1.2538 0.957 — — —
    ProperVelocity.expmap (vmap) 5.8779 6.7439 1.15 — — —
    horo_projection (vmap, K=3) 5.8367 7.2006 1.23 — — —
    frechet_mean (max_iters=100) 73.4981 52.3895 0.713 — — —
    prim Hyperboloid.addition value_and_grad(both) 17.3033 3.4826 0.201 — — —
    prim Hyperboloid.expmap 2.8512 4.9346 1.73 — — —
    prim Hyperboloid.tangent_inner 1.9195 6.7360 3.51 — — —
    prim Hyperboloid.ptransp 9.7918 8.8648 0.905 — — —
    prim lorentz_midpoint 3.9228 111.3655 28.4 — — —

    Every consumer of the gyro-addition is about 2x faster on CPU and unchanged on GPU. GyroBatchNorm is 0.57–0.61x as-is on CPU; on the A100 it measured 0.78–0.88x in one run and 0.96–0.97x on the repeat, i.e. unchanged within GPU noise — so the key-Gram intermediate's 148x (CPU) / 14.5x (GPU) never reached a release (the numbers in the key-Gram column of the summary). The rows above 1.5x and why: attention and the lorentz_midpoint primitive on CPU because XLA:CPU materialises the variance form's (…, N, M, D) difference (Mflop only 1.3x for attention) while XLA:GPU fuses it (attention 1.62x / 1.48x on the A100), LorentzResidual on CPU for its pairwise polar frame, the Busemann head (CPU streaming of the exact broadcast-reduce; 2.1–4.4x on the A100 at 0.41–2.40 ms absolute, the decided trade), prim Hyperboloid.expmap and tangent_inner (three reductions instead of one; only the Riemannian optimizer's second moment and frechet_mean call them, and the optimizer step is 1.02x). GPU repeatability from the repeat run probe_cost_gpu_5b756df_rep2.out: worst 39.4% on the float64-island GEMM K=1000 fwd row, 24.1% on GyroBatchNorm fwd+bwd, so GPU ratios inside ±1.3x are noise. - The batched Busemann head, nn_layers.busemann_core._busemann_score, and the vmapped busemann shared by the Busemann MLR/FC layers use the same projected-coordinate formula as Hyperboloid.busemann. The measurements in probe_midpoint_horopca_busemann_pv_9093ea7.out describe the preceding large-radius value repair; the current formula additionally preserves the constrained origin derivative. - Hyperboloid._addition builds its time slot with _time_slot directly instead of _proj(concatenate([0, s])). Bit-identical value and gradient; a GPU-only performance fix. The dead zero-slot pad/slice pair in the backward made XLA:GPU root a multi-output fusion in a column reduction instead of a row reduction: on an A100 (jax 0.9.1, float32, c=0.5, B=4096, D=64) the dominant kernel of that fusion, input_multiply_reduce_fusion, cost 1769.5 µs/call as the boost was first merged (diag_plfc_kernels_900f054.out) — against 87.9 µs/call for the same fusion before the boost rewrite existed at all (diag_plfc_kernels_b586169.out, the pre-boost round-trip spelling) — and now costs 53.9 µs/call (diag_plfc_kernels_fixed.out). Total device time for HypLinearHyperboloidPLFC(65, 65, use_gyro_bias=True)'s forward+backward kernels drops from 2052.2 µs/call to 356.4 µs/call; the AOT wall-clock forward+backward (median of 50 calls) is 0.5810 ms fixed (diag_plfc_gpu_fixed.out), forward alone 0.1738 ms. Output and ∂L/∂gyro_bias are bit-identical to the round-trip spelling.

Added

  • ProperVelocity.gyro_difference(x, y, c) — the PV gyrovector difference (⊖x) ⊕ y, evaluated through the exact direct lift to Hyperboloid.gyro_difference. Use it for centering and for differences expected to lie much closer to the origin than their operands. ProperVelocityGyroBatchNorm uses it for centering.
  • HyperbolicFullAttention(score_dtype=...). An opt-in float64 island for the Lorentzian similarity score: the two einsums and the 2 + 2⟨Q,K⟩_L / scale / bias / causal-mask arithmetic run in score_dtype and are cast back to the working dtype before the softmax. score_dtype=None (the default) leaves the score path unchanged op for op. The GEMM-formed score has no cancellation-free spelling — any matrix product of the ambient coordinates returns the Gram matrix to absolute eps — so past a ≈ 8 (c=1, scale=1) the absolute score error eps·cosh(a_q)·cosh(a_k)/(c·scale) exceeds what softmax can resolve; score_dtype=jnp.float64 fixes the arithmetic but not float32 storage of the activations themselves — see docs/user-guide/numerical-stability.md.
  • Hyperboloid.gyro_difference(x, y, c) — (⊖x) ⊕ y for centering a batch on its mean and differences expected to lie closer to the origin than their operands. It is mathematically identical to addition(scalar_mul(-1, x), y), using a Cartesian inverse boost when either endpoint's scaled spatial radius is at most 1e-1 and the stable polar frame otherwise. The historical equivalence measurements in step2c_gyro_difference_equivalence.out predate the Cartesian origin repair. HyperboloidGyroBatchNorm uses this method for centering.

1.2.1 - 2026-09-06

Fixed

  • The origin Jacobian of Hyperboloid.expmap / expmap_0 was √c·I instead of I for every c < 1. It bit whenever the tangent vector satisfied ‖v‖ ≲ 1e-15/√c, the zero tangent included: the divisor of the sinh(t)/t ratio carried a second MIN_NORM floor (denom = floor_at(√c·‖v‖, MIN_NORM)) that the numerator did not, so at v = 0 the ratio evaluated to √c·1e-15 / 1e-15 = √c rather than 1 and the whole spatial Jacobian came out scaled by √c — a zero-initialised gyro-bias saw its first gradient scaled by 0.32 at c = 0.1, 0.55 at c = 0.3, in both dtypes (c ≥ 1 was unaffected, since the floor is inactive there). Found by an independent numerics review. The divisor is now the same floored t = √c·‖v‖, which is ≥ √c·1e-15 > 0 and normal in both dtypes, so sinh(t)/t is exactly 1 there; the Poincaré, stereographic and proper-velocity exponential maps already divided by a single floored quantity and are unchanged. test_hyperboloid_expmap_at_the_origin_has_the_identity_jacobian pins the identity at c ∈ {0.1, 0.3, 1, 2.5} in both dtypes, and test_hyperboloid_gyro_bias_at_the_origin_has_a_nonzero_jacobian now runs at c = 0.1 as well as c = 1.
  • The norm-rescale divisor was not an exact power of two in float64 on CUDA, so the rescale it exists to make rounding-free put a rounding into every division it scales. _pow2_divisor built the divisor with jnp.ldexp, which computes m · 2**e and lowers to an XLA power — a ~1 ulp transcendental on CUDA rather than an exact exponent shift. On an A100 (jax 0.9.1) that came out an ulp low for 75 of the 600 binades k ∈ [-300, 300); ldexp(1.0, -33) returns one ulp below 2**-33. The divisor is now built by masking the mantissa bits off m, which leaves 2**floor(log2 m) exactly on every backend, with the old minexp floor replaced by a finfo.tiny floor (a subnormal m masks to 0). Affected safe_norm, safe_hypot, safe_hypot_norm and safe_normalize on GPU, in float64 only — float32 was already exact on both backends, and CPU float64 was too; values there are bit-identical before and after (checked over every binade of both dtypes plus 0, inf, nan, the subnormals, finfo.tiny and finfo.max). It showed up as test_the_norm_rescale_adds_no_rounding_of_its_own failing on GPU with mean ulp distance 0.27–0.34 against 0.000 on CPU. test_the_rescale_divisor_is_an_exact_power_of_two_on_every_backend now pins zero mantissa bits and the correct binade over the full exponent range of both dtypes.

Changed

  • Float32 matmul precision is now split by what the dot product computes, not by where it lives, and there is no hyperbolix-specific knob for it. MATMUL_PRECISION = jax.lax.Precision.HIGHEST is pinned on the geometry and is not user-configurable: the vector-vector reductions in manifolds/ (behind dist, addition, gyration, expmap, logmap, ptransp, tangent_inner, egrad2rgrad, the Lorentz inner product, the Busemann coordinate and the boundary factors) and the HoroPCA contractions in decomposition/; lorentz_midpoint and the Poincaré poincare_weighted_midpoint, the two Fréchet-mean normalizers whose cancellation-free identity only holds to O(eps) on float32-accurate inputs; the conv_general_dilated_patches patch extraction in the hyperboloid, Poincaré and proper-velocity convolutions, which XLA implements as a convolution against a 0/1 filter — a pure data copy, where TF32 would round every input to a 10-bit mantissa for no throughput at all; the attention score and aggregation einsums in hyperboloid_attention.py (the Lorentzian similarity, the softmax scores and weighted values, the linear-attention kernel sums) and the spatial residual projection added to that aggregate; and the point-to-hyperplane einsums — HypRegressionHyperboloid and FGGLorentzMLR plus the three batched _compute_mlr einsums in manifolds/hyperboloid.py, poincare.py and proper_velocity.py — whose asinh argument is a difference of a radial and an angular term that cancels. That last pin reaches into the hidden layers too: HypLinearHyperboloidPLFC, HypLinearPoincarePP, HypLinearPV, HypConv2DHyperboloidILNN, HypConv2DPoincare and HypConv2DPV are those einsums applied to their own kernel, so their weight GEMM runs at HIGHEST as well. What the head's pin costs, measured on an H100 against 1.1.2 (every dot at TF32): the HypRegressionHyperboloid forward alone, B=1e7, 10 classes, is 2.6x at D=128 and 2.0x at D=32 (1.02x of 1.2.0, which pinned it too); in a training step expmap_0 → HTCLinear ×2 → HypRegressionHyperboloid at B=262144, D=128 the pin is the residual 1.05x over 1.1.2 once the GEMM pin and the norms are given back (the same step was 1.00x on the tree before the split). The hyperbolic attention layers, whose score and aggregation einsums are pinned, are 1.25–1.31x of 1.1.2 at (8, 256, 257) and 0.76–0.80x of 1.2.0. On an A100 (jax 0.9.1) the float32-vs-float64 relative error of lorentz_midpoint is 4.6e-5 … 2.6e-4 at the TF32 default against 2.6e-8 … 1.6e-7 under HIGHEST, a ~2000x difference; the eager float32 gradient of the hyperboloid MLR goes from 1.5e-4 to 2.7e-7 relative over the same switch.
  • The layer weight GEMMs carry no precision keyword at all and follow JAX's own jax_default_matmul_precision — TF32 on Ampere/Hopper. HTCLinear — the attention Q/K/V projections included — FGGLinear/FGGConv2D, the FHCNN and FHNN linear forwards, HypLinearPoincare, HypVQMLRPoincare's implicit-codebook matmul and hybrid_regularization's nnx.Linear. One of them carries a cancellation and is still left on the default: the FGG hidden dot x @ V absorbs the Minkowski metric into V, so the -x0*V0 + <x_s, V_s> cancellation happens inside one accumulation — the same product FGGLorentzMLR pins — and the comment on the jnp.matmul in nn_layers/hyperboloid_linear._fgg_linear_forward says so. It is left there deliberately: at depth 16, c = 1, input geodesic radius 5, an FGGLinear stack's float32 parameter-gradient error under the default is 0.199 % relative L2 against a float64 reference and its input-gradient error 0.274 %, against 1.539 % / 2.013 % for an HTCLinear stack, which has no cancellation at all — so the in-accumulation cancellation is not what dominates there (independent A100 measurement, jax 0.9.1, logs/2026-09-06_numerics_independent_review/training/gpu/depth.json; under global HIGHEST the same four cells are 8.0e-7 / 1.0e-6 and 2.5e-6 / 1.2e-5). Those depth-16 numbers are the worst cell of a 24-cell grid (depths 2/8/16, c ∈ {0.1, 1}, input radius {0.5, 5}), one initialisation and one input draw per cell and no seeds — grid maxima at n = 1, not means, and the HTC stack's measured radius climb (≈0.35 nats per layer at large radius) and the hypothesis linking it to the depth-16 error are in the hyperbolix/utils/precision.py docstring. At depth 2 the choice is invisible in training: 5 seeds per arm, D = 128, B = 256, c = 1, 2 000 Adam updates, mean heldout loss 0.27736 (default) against 0.27738 (HIGHEST) for HTC and 0.28610 against 0.28614 for FGG, on a seed spread of ~0.015–0.017. HTCLinear is where that choice is visible in the test suite: test_attn_output_shape_and_jit and test_causal_first_token_self_only compare two lowerings of the same algebra at a 1e-5 tolerance, which TF32's run-to-run rounding exceeds, so both now wrap their forward passes in jax.default_matmul_precision("highest") — the tolerances are unchanged and the TF32 values are not wrong. These are the sites where HIGHEST actually costs throughput — it replaces one TF32 pass with a three-pass float32 emulation, measured +5.5 % on a jitted hyperbolic attention forward — so the trade is the user's to make, through JAX rather than through a hyperbolix-specific attribute: jax.config.update("jax_default_matmul_precision", "highest"), or scoped, with jax.default_matmul_precision("highest"):. Both are jit-cache aware (changing them re-traces), and both cover the pinned sites too, so one line runs the whole package in full float32. A deep, fully hyperbolic stack is a good reason to set it: a TF32 error introduced in an early layer's weight GEMM is carried by every layer after it, and it is not small. Measured on an A100 (jax 0.9.1, ambient dim 33, batch 64, c in {0.1, 1.0} x spatial radius in {0.5, 5, 20}, float32 against a float64 reference): FGGLinear 2.6e-4 at the TF32 default against 6.8e-8 under HIGHEST, FGGLorentzMLR 1.3e-4 … 3.6e-4 against 3.6e-8 … 9.6e-8 — roughly ~1e-4 against ~1e-7 on the layers, three of float32's seven significant digits. HIGHEST is a no-op on CPU (no TF32 path) and for float64 anywhere.
  • The per-sample norms that 1.2.0 measurably made slower are a single reduction again — and only those. A site is converted where 1.2.0 measured slower (hyperboloid expmap_0 1.28x, HTCLinear forward+backward 1.12x, on both A100 and H100) or where PR #75 raised the compiled kernel / reduction count. That is: Hyperboloid.proj/proj_batch/dist_0 (both version slots); the shared gyrovector proj/proj_batch behind Poincare and Stereographic, and Poincare.expmap; and spatial_to_hyperboloid (so HTCLinear), the FHCNN linear forward and the FGG linear forward. Everywhere else 1.2.0's max-scaled two-pass norm stays, with its full-range guarantee. In isolation that costs something — about 1.2–1.35x the one-pass form on a forward pass in float32 (h_logmap_0 and Poincare.expmap_0 at D = 32/B = 4096 and D = 128/B = 262144, c ∈ {0.1, 1}: 1.202–1.343, independent A100 measurement, jax 0.9.1, logs/2026-09-06_numerics_independent_review/timing/norm/ — this range rests on that measurement alone; the 1.28x above is a v1.2.0-vs-v1.1.2 tree ratio of a converted site, not a one-pass/two-pass swap of a retained one) — but inside a training step it shrinks to ≤ ~1.05x (0.92–1.05x on the same probe's complete-step and HTC-chart rows), which is why the two-pass norm is kept wherever the operand's magnitude is unbounded. The retained sites: hyperboloid logmap_0 (which measured faster in 1.2.0), the pairwise dist/logmap polar frame, hyperboloid and Poincaré tangent_norm, Poincare.expmap_0 (no measured change either way), the FHNN linear forward, the linear-attention focus_transform (converting it measured no speedup of its own), every ProperVelocity operation and the proper-velocity isometry maps, the Poincaré metric-tensor distances, the rest of Stereographic, Euclidean and ProductManifold, and the wrapped-normal log_prob. The converted spellings are safe_sqrt(sum(v**2)) where the input can be exactly zero, a plain sqrt(const + sum(v**2)) where a strictly positive constant is added, and floor_at(..., MIN_NORM) around either where the norm is a divisor. Every gradient fix from 1.2.0 is kept: safe_sqrt's double-where gives the same exact 0 and exactly-zero VJP at the zero vector that safe_norm did, so jax.grad at coincident points and at the origin stays finite.
  • Past float32 coordinate 1.8e19 the converted sites give up their answer, and what they give instead was measured rather than argued. That coordinate is geodesic radius ~45 at c = 1 and ~139 at c = 0.1, in float32; a network out there is already diverging, and inf is the intended signal rather than a plausible finite answer. Measured, float32, c = 1: Hyperboloid.proj/proj_batch give x0 = inf with the spatial part unchanged and no NaN; dist_0 gives inf on both version slots; spatial_to_hyperboloid/HTCLinear and the FHCNN forward give x0 = inf with no NaN; the FGG linear forward gives a non-finite output (NaN or inf, depending on the input — an all-NaN output on the probe's 5e19 spatial input, inf with no NaN on a second, crafted one); the Poincaré and κ-stereographic boundary clamps give the origin — a finite point, with a finite (exactly zero) gradient there — because x * (max_norm / inf) is the zero vector, the pre-1.2.0 behaviour; and Poincare.expmap gives the base point, a finite point, inheriting the same clamp. Two of the converted sites therefore do saturate to a finite point, and that is the clamp's documented behaviour. Everything on the two-pass norm — Poincare.expmap_0, which still returns the correct boundary point, and the linear-attention focus_transform included — behaves exactly as in 1.2.0.
  • The maximum radius the converted origin-chart operations can represent drops with it. For proj and dist_0 the ceiling used to be x₀'s — the two-pass norm never formed ‖x_s‖², so what bound the radius was cosh(a)/√c ≤ finfo.max, i.e. a = ln(2·finfo.max): radius ~89 in float32 / ~710 in float64 at c = 1 (89.416 / 710.476, the same number as arcsinh(finfo.max), since sinh(a) and cosh(a) leave the dtype together). It is now the coordinate limit sinh(a)/√c < sqrt(finfo.max) — radius ~45 in float32 and ~356 in float64. logmap_0 and the pairwise dist/logmap keep the two-pass norm and so keep a ceiling of that order: logmap_0 reads only ‖y_s‖ and keeps the old ~89 / ~710 exactly, while the pairwise pair binds a fraction of a radius earlier at e^a/√c ≤ finfo.max (a = ln(finfo.max), 88.72 / 709.78), because _polar_frame forms u = x₀ + ‖x_s‖ and returns ±inf once that overflows. Every hyperbolic model in the literature lives four to five orders of magnitude inside every one of these limits.
  • safe_norm, safe_hypot_norm and safe_normalize remain public and are what every unconverted per-sample site and every once-per-forward weight norm still use. safe_hypot is a hot-path two-leg scalar composer, not a weight-norm primitive: the hyperboloid polar frame builds its radial and angular legs with it.
  • One deliberate value change: the hyperboloid time slot is now sqrt(1/c + sum(x_s**2)) instead of sqrt((1/sqrt(c))**2 + sum(x_s**2)), one rounding fewer and in the more accurate direction (Hyperboloid.proj/proj_batch, nn_layers.hyperboloid_core.spatial_to_hyperboloid, and the FHCNN/FGG layer forwards; isometry_mappings.pv_to_hyperboloid keeps 1.2.0's spelling). Everywhere else safe_norm/safe_hypot_norm were bit-identical to sqrt(sum)/sqrt(sum + q**2) on the finite domain, so values move only by XLA association noise (0-2 ulp).
  • The hyperboloid time slot carries a custom_jvp whose only job is the backward's XLA fusion shape. With the one-reduction sqrt(1/c + sum(x_s**2)), XLA:GPU fused the backward's reduction into a full-width Triton kernel and left the cotangent's re-embedding pad as a standalone copy of the whole batch, so jax.grad of proj/expmap_0 at B=1e7, D=128 ran 1.35x/1.76x slower than 1.1.2 on an H100 even though the forward was as fast; v1.1.2 avoided this only through the maximum(…, MIN_NORM) its VJP happened to place between the reduce and the sqrt. The module-private _time_slot rule states the same derivative AD derives (the 1/c cotangent 1/(2·x0) included, so a traced LearnableCurvature is unaffected) and puts a lax.optimization_barrier on the per-row 1/x0, which restores 1.1.2's kernel structure (proj.grad 3/1, expmap_0.grad 7/3 kernels/reductions at D=128). Forward values are bit-identical; jax.jvp/jacfwd keep working. test_hyperboloid_time_slot_custom_jvp_matches_plain_autodiff checks value, gradient, forward-mode tangent and the curvature cotangent against the rule-free spelling. The fusion effect it fixes is shape- and consumer-dependent, so it will not reproduce everywhere: it appeared in float32 on jax 0.9.1 at B ≥ 1e6, at both D = 32 and D = 128 (expmap_0.grad 1.48x of 1.1.2 at B = 1e6 and 1.76x at B = 1e7 for D = 128, and 1.60x at B = 1e7 for D = 32, with proj.grad 1.35x at either width; absent at B = 1e5, 0.98x at D = 128 — logs/2026-09-04_safe_norm_hot_path_revert/RESULTS_31403c2.md, .../vda/timing_D{32,128}/ and .../vda3/timing_D{32,128}/, two different H100 hosts with every ratio against a v1.1.2 arm from the same host and run), and only for a backward that materialises the full (B, n) cotangent, e.g. jax.grad of a sum over the output. With a scalar-loss consumer the pad fuses anyway: an independent A100 measurement of jax.grad(mean(f(x)**2)) at B ≤ 262144, D = 128 put the barrier arm within ~1 % of the rule-free spelling for expmap_0 forward+backward at the large shape (1.003-1.006 at both c = 1 and c = 0.1, against either spelling without the barrier); the proj rows of the same run are noisier (one contaminated round).
  • One extreme-radius test row moved from float32 to float64. It was exercising the retired overflow guard rather than the algorithm, so it follows the guard rather than being loosened; tolerances are unchanged. In tests/test_manifold_oracles.py, test_hyperboloid_dist_and_logmap_to_the_origin_match_the_origin_variants now takes a per-dtype radius grid — float32 stops at 43, float64 keeps 45. What binds is the spatial coordinate sinh(a)/sqrt(c), which passes float32's 1.845e19 at radius 45 for c = 0.3, where the converted dist_0 returns inf by policy; exactly that one cell of the grid crosses the threshold, and 43 is the repo's existing float32 radial ceiling. This narrows the float32 coverage rather than preserving it: the radius-45 cell is no longer exercised in float32 at all, only in float64. The pairwise oracle rows are untouched, because the pairwise dist/logmap keep the two-pass norm.

Removed

  • The smooth_clamp on the asinh argument of every MLR head is gone, and with it the clamping_factor and smoothing_factor parameters of Hyperboloid.compute_mlr, Poincare.compute_mlr_pp, ProperVelocity.compute_mlr and the four _compute_mlr helpers, plus every layer that only carried them to forward: HypRegressionHyperboloid, HypRegressionPoincare, HypRegressionPoincarePP, HypRegressionPV, HypLinearHyperboloidPLFC, HypLinearPoincarePP, HypLinearPV, HypConv2DHyperboloidILNN, HypConv2DPoincare, HypConv2DPV and HypVQMLRPoincare. This is a signature break: drop the two keywords at the call site. asinh is defined on all of R with derivative 1/√(1+x²) ≤ 1, so it needs no guard — the only infinite argument comes from a point that has already overflowed the float32 manifold, and the clamp turned that into a finite, plausible logit and hid the divergence; the logit is now inf and the loss NaN, which is the failure you want to see. The bound was also dtype-dependent (log(2/eps): ±16.6355 in float32 against ±36.7368 in float64), so the two dtypes disagreed by design: measured with HypRegressionHyperboloid at c = 1, geodesic radius 5, default init, batch 256 × 10 classes, the float32 logits sat 9.4e-2 (D = 128, 1.2% of cells clamped) and 1.8e-1 (D = 32, 22.4% clamped) from the float64 ones relative to the largest logit, identical under TF32 and HIGHEST; with the clamp gone the same cells agree to 6.4e-7 / 4.6e-7. Every clamped cell also had an exactly zero input gradient (smooth_clamp's slope past its bound is exp(-50·d)), freezing those points under SGD, and at c = 1 with the shipped init the float32 bound first bit at geodesic radius 4.25 (D = 32) / 4.75 (D = 128) — well inside the range the library documents as float32-reliable. Neither reference clamps this quantity: HNN++ (mil-tokyo/hyperbolic_nn_plusplus) guards only the 1 - c‖x‖² denominator and the weight norms at a flat 1e-15, and HCNN's LorentzMLR (kschwethelm/HyperbolicCV) has no guard at all; the line came from the author's earlier PyTorch code (univie-dm/hyperbolic_math, helpers.py, "Improve the performance by smoothly clamping the input of asinh()") with no recorded rationale. smooth_clamp itself stays in hyperbolix.utils.math_utils and is unchanged
  • The three float32 overflow oracles in tests/test_manifold_oracles.py are retired, since the guard they tested is gone. test_hyperboloid_proj_time_slot_survives_the_float32_overflow becomes test_hyperboloid_proj_time_slot_is_exact_at_an_enormous_radius in float64, and test_poincare_proj_clamps_a_far_point_to_the_boundary_not_to_the_origin moves to float64; both then assert the algorithm rather than the dtype's range. test_hyperboloid_expmap_0_saturates_to_a_consistent_point_not_an_infinite_time_slot cannot move — sinh clips its argument at 0.99*log(finfo.max) in both dtypes, so the capped spatial value squared overflows in float64 too — and is replaced by test_hyperboloid_expmap_0_past_the_sinh_cap_is_infinite_not_nan, which pins the weaker but real contract: x0 = inf, spatial part finite, no NaN.
  • Hyperboloid.dist/dist_0 slots 2 and 3 (VERSION_LEGACY, VERSION_LEGACY_SMOOTHENED) are gone; a version_idx outside {0, 1} now raises ValueError. The explicit check is needed because lax.switch silently clamps an out-of-range index into range, so a stale version_idx=2 would have quietly run the smoothened arm instead of failing. The two slots were added in 1.1.2 / 1.2.0 by the very fixes that made them obsolete (the cancellation-free dist rewrite and the origin-chart dist_0 rewrite); at 1.1.1 the switch had only two slots, so no pre-fix code ever passed 2 or 3, and pre-fix numbers remain reproducible by installing hyperbolix==1.1.1 from PyPI. For the record, the four golden values the deleted regression test pinned — on-sheet point at spatial radius 1e-3, c = 1, dim 8, direction e1, true geodesic radius 9.99999833e-4 — were: slot 2 float32 0.0015440807910636067, slot 2 float64 0.0009999998333921221, slot 3 float64 0.16632065504083338, slot 3 float32 0.16632071137428284 (CPU; ±1 ulp on an A100)

1.2.0 - 2026-09-04

Fixed

  • Every zero-initialised hyperboloid gyro-bias was frozen at its init value: ∂(x ⊕ b)/∂b at b = origin was exactly the zero matrix, in both dtypes. dist_0 short-circuited on a bitwise at_origin guard (jnp.where(at_origin, 0.0, res)); logmap_0 scales the spatial part by dist_0(y)/‖y_s‖ and inherited it; Lorentz gyro addition x ⊕ y = Exp_x(PT_{0→x}(Log_0(y))) inherited it in turn. A bias parameter that starts at the origin, which is what use_gyro_bias=True does, therefore received an exactly-zero gradient at step 0 and never left. Affected layers: HypLinearHyperboloidPLFC, HypConv2DHyperboloidILNN, HypLinearHyperboloidBusemann. Measured gyro-bias gradient L2 at init (c = 1, dim 8, batch 4, dist_0 loss, before → after): float32 0.0 → 1.37 (PLFC), 0.0 → 4.24 (ILNN conv), 0.0 → 3.07 (Busemann FC); float64 0.0 → 1.48, 0.0 → 5.37, 0.0 → 1.83. In float32 the gradient was additionally ~1400x over-scaled the moment the bias left the origin, because the acosh floor below was divided by the true radius: the PLFC gradient at bias radius 1e-6 was 1535x its value at 1e-2, a ratio that is now 1.06x. The Poincaré HypLinearPoincareBusemann gyro-bias goes through Möbius addition and was never affected (7.64 before and after). A model trained with a gyro-bias on any of the three hyperboloid layers was trained with that bias pinned to the origin; retraining under this fix changes results.
  • Hyperboloid dist_0/logmap_0 recovered the geodesic radius from the time coordinate x₀, which cannot resolve a small radius; they now read it off the spatial part. dist_0 was acosh(clip(√c·x₀, 1))/√c. On the sheet x₀ = cosh(√c·d)/√c ≈ (1 + c·d²/2)/√c, so d survives only to sqrt(eps) resolution (relative error eps/(2·c·d²)), and acosh's 1 + 10·eps domain clamp flattened every float32 radius below sqrt(20·eps)/√c = 1.5441e-3 onto that floor value (1.5441e-3 was returned for every such point, 1500x too large at radius 1e-6; only the bitwise origin returned 0). The smoothened arm was worse: smooth_clamp_min (β = 50) adds ln2/50 to the acosh argument, i.e. a floor of acosh(1 + ln2/50)/√c = 0.16632/√c under every point that is not bitwise the origin, in both dtypes (measured: it returned 0.16632 at every radius ≤ 1e-2 and 0.1815 at radius 0.1, agreeing with the true value only from radius ≈ 1). Slot 0 is now the exact on-sheet identity arcsinh(√c·‖x_s‖)/√c, with no domain clamp and a derivative bounded by 1; slot 1 is the same with the spatial radius floored in quadrature at 20·eps, a floor of arcsinh(20·eps)/√c (2.4e-6/√c float32, 4.4e-15/√c float64) that equals the pairwise smoothened floor 2·arcsinh(10·eps)/√c from 1.1.2 to first order. logmap_0 is now [0, arcsinh(u)/u · y_s] with u = √c‖y_s‖: it no longer routes through dist_0's version switch, ‖log_0(y)‖ = dist_0(y) holds by construction instead of by cancelling a floored numerator against an unfloored denominator, and the trailing tangent_proj is dropped (it is the identity at the origin, but it routes through the Minkowski inner product, which turns one inf spatial coordinate into an all-NaN vector). scalar_mul is now literally exp_0(r · log_0(x)); its old normalize-then-rescale detour carried a sqrt(max(‖v‖², MIN_NORM)) floor, an effective 3.16e-8 floor on ‖log_0 x‖ that was invisible only while the larger acosh floor sat in front of it. Median relative error at c = 1, dim 8 (A100, jax 0.9.1; the CPU backend and jax 0.11.0 agree in every floored cell):

    radius float32 dist_0 float32 log_0(exp_0(v)) float64 dist_0 float64 round trip
    1e-6 1.5e3 → 2.5e-9 1.5e3 → 0 4.4e-5 → 0 4.4e-5 → 1.3e-16
    1e-3 5.4e-1 → 9.8e-8 5.4e-1 → 0 5.9e-11 → 0 1.5e-10 → 1.2e-16
    1e-2 5.0e-4 → 2.7e-8 5.2e-4 → 0 1.0e-12 → 1.7e-16 8.3e-13 → 1.2e-16
    0.1 3.5e-6 → 1.8e-8 1.4e-7 → 3.9e-8 7.6e-15 → 1.4e-16 9.5e-15 → 1.1e-16
    1 to 40 ≤7.1e-8 → ≤5.2e-8 ≤1.0e-7 → ≤8.8e-8 ≤1.3e-16 → ≤1.9e-16 ≤1.4e-16 → ≤1.4e-16

    Consumers that inherit the fix with no change of their own: gyro addition, scalar_mul, logmap's origin fallback, HyperboloidGyroRMSNorm (it divides by dist_0, so in float32 every sample inside radius 1.5e-3 was mis-normalised), and the three gyro-bias layers above. Pairwise dist(origin, x) is a separate code path and still carries an O(eps/r) relative error from the _polar_frame gap term near the origin (float32: 4.6e-2 at radius 1e-6, ~1e-3 at 1e-4); closing that is a planned separate change, so prefer dist_0 for distances to the origin. Supersedes the claim in the 1.1.2 entry below that origin-chart operations "read the radius straight off the ambient time coordinate and were never affected": reading it off the time coordinate is precisely the defect fixed here. That entry's two-point cancellation claims, and expmap_0, are unchanged

  • On an Ampere or Hopper GPU, lorentz_midpoint and the three hyperbolic attention layers silently ran their matmuls in TF32, costing ~2000x accuracy in the one place the library cannot afford it. XLA:GPU defaults float32 matmuls to TF32, whose 10-bit mantissa carries ~1e-3 relative error against float32's ~1e-7. lorentz_midpoint's whole design is a cancellation-free identity in which every rounded term is O(‖delta‖²), so that the normalizer stays accurate at any radius — TF32 is far coarser than the effect that identity exists to remove. Measured float32-vs-float64 relative error of lorentz_midpoint (A100, jax 0.9.1, c ∈ {0.1, 1.0} × ‖s‖ ∈ {0.5, 5, 20}): GPU default 4.6e-5 … 2.6e-4, GPU with the fix 2.6e-8 … 1.6e-7, CPU 2.6e-8 … 1.2e-7 — i.e. three of the seven significant digits were gone, with no warning, in every hyperbolic attention or Fréchet-mean computation on such a card. The worst site is HyperbolicFullAttention's Lorentzian similarity, which evaluates ⟨Q,K⟩_L = -Q₀K₀ + ⟨Q_s,K_s⟩ as the difference of two matmuls — the exact cancellation _polar_frame was written to avoid, with both halves produced by TF32 GEMMs, so the subtraction amplifies a ~1e-3 input error rather than a ~1e-7 one. Fixed by annotating the cancellation-sensitive dots with precision=jax.lax.Precision.HIGHEST through one documented constant, hyperbolix.nn_layers.hyperboloid_core.MATMUL_PRECISION: the three jnp.einsums in lorentz_midpoint, the ten score / Lorentz-inner-product / aggregate einsums in hyperboloid_attention.py, the spatial residual projection the linear and softmax variants add to that aggregate, and HTCLinear's matmul — the last because it produces the Q/K/V the Lorentz inner product then cancels, and a TF32 input makes an accurate cancellation pointless (annotating only the attention einsums left 6 of the 7 attention tests red; adding HTCLinear left 2; adding the residual projection cleared them). This turned 14 of the 21 GPU-only test failures green (all 7 attention, all 7 lorentz_midpoint). HIGHEST is a no-op on CPU (no TF32 path) and for float64 anywhere; the CPU outputs of lorentz_midpoint and of a HyperbolicFullAttention forward are bit-identical before and after, eager and jitted, in both dtypes. On a tensor-core GPU it does trade GEMM throughput for accuracy, since HIGHEST replaces one TF32 pass with a three-pass float32 emulation: a jitted HyperbolicFullAttention forward at B = 8, N = 256, 4 heads, head dim 64, float32 measured a median 1.84 ms with the fix vs 1.74 ms at the TF32 default, +5.5 % (A100-PCIE-40GB, 5 warmup + 20 timed calls; the card was idle but shared, so treat the ratio as indicative)

  • The hyperboloid MLR forward dot ran in TF32 on the same cards, for the same reason: _compute_mlr forms alpha = -x₀·sinh(√c·r)·‖z‖ + cosh(√c·r)·⟨x_s, z⟩, a difference whose second term is a matmul. The einsum now carries precision=HIGHEST (spelled out locally — manifolds/ must not import from nn_layers/). Measured on an A100 against a float64 reference at identical inputs: the eager float32 gradient of _compute_mlr improves from 1.5e-4 to 2.7e-7 relative; the forward was already accurate (1.1e-7) on both settings. This does not fix the separate, intermittent 1 % error in the jitted float32 gradient of the same function, which survives every precision setting; that one is the jnp.maximum tie-break in the next entry
  • The remaining float32 dots on manifold data still ran in TF32 on Ampere/Hopper — the x @ V matmuls where the Minkowski metric is absorbed into the weight matrix, and the HoroPCA and Poincaré-MLR contractions. PR #70 closed the Lorentz cancellations that are written as an explicit difference of two dots (lorentz_midpoint, the attention scores, the hyperboloid MLR); this closes the rest. FGGLinear, FGGLorentzMLR and HypRegressionHyperboloid evaluate ⟨x, V⟩_L as one x @ V with the metric folded into V, so the -x₀V₀ + ⟨x_s, V_s⟩ cancellation happens inside a single TF32 accumulation and the ~1e-3 input rounding lands directly on the cancelled result. Measured float32-vs-float64 relative error on an A100 (jax 0.9.1, ambient dim 33, batch 64, c ∈ {0.1, 1.0} × spatial radius ∈ {0.5, 5, 20}; median over the batch, before → after): FGGLinear 2.6e-4 → 6.8e-8 (a 3700-3900x improvement at every cell), FGGLorentzMLR 1.3e-4 … 3.6e-4 → 3.6e-8 … 9.6e-8 (2200-3800x), horo_projection 4.0e-4 … 4.9e-3 → 2.8e-7 … 2.4e-6 (1400-2600x, the ideal-span Minkowski projections), HoroPCA.transform 1.9e-4 … 2.3e-3 → 3.4e-7 … 4.3e-6 (520-1560x, the Fréchet-mean Lorentz boost x @ Bᵀ plus the component-frame read-off), and the Poincaré HNN++ MLR compute_mlr_pp 3.8e-5 … 1.4e-4 → 6.0e-8 … 2.2e-7 (440-1740x). The fix is one library-wide setting rather than a per-call keyword: MATMUL_PRECISION = jax.lax.Precision.HIGHEST now lives in hyperbolix.utils.precision — a neutral home both manifolds/ and nn_layers/ can import from, so manifolds/hyperboloid.py::_compute_mlr imports it instead of spelling lax.Precision.HIGHEST locally — and is attached to all 87 float32 dot products in the package that touch points, tangent vectors or hyperplane normals (70 of them newly). hyperbolix.nn_layers.hyperboloid_core.MATMUL_PRECISION re-exports it, so existing imports keep working unchanged. Covered: the Poincaré/κ-stereographic/proper-velocity/gyrovector-core jnp.dot reductions behind dist, addition, gyration, expmap, logmap, ptransp, tangent_inner, egrad2rgrad and the boundary factors 1 - c‖x‖²; the hyperboloid _minkowski_inner, _proj time reconstruction, polar-frame Gram-Schmidt, tangent_norm radial split and Busemann coordinate; the isometry maps between the three models; HypLinearHyperboloidFHCNN/FHNN and HypLinearPoincare's tangent-space matmuls; the Poincaré batch-norm weighted gyromidpoint; HypVQMLRPoincare's implicit-codebook matmul; and the hyperboloid/Poincaré/PV conv patch extraction (conv_general_dilated_patches carries ambient channels, time slot included). HIGHEST is a no-op on CPU and for float64 anywhere, and the change is verified bit-identical: 280 CPU arrays covering every touched public entry point, forward and jax.grad, eager and jitted, in both dtypes, match the base commit exactly. The single-vector jnp.dot sites measured no GPU change either way (XLA lowers a vector-vector dot to a reduction rather than a tensor-core GEMM), so those annotations are insurance against a future lowering or a batched rewrite rather than a behaviour change today
  • The ‖z‖ floor in the hyperboloid MLR silently zeroed the entire ∂‖z‖ branch of its gradient on GPU, for one output channel at a time, in roughly two of every three process launches. _compute_mlr floored the hyperplane-normal norm with jnp.linalg.norm(z, ...).clip(min=min_enorm), i.e. jnp.maximum(n, eps). That op's JVP is jax's tie-breaking _balanced_eq, g · [n == ans] / (1 + [eps == ans]) — it tests the operand n for bit equality with the result ans, which is sound only while the two are literally the same value in the compiled graph. XLA:GPU emits n = sqrt(sum(z*z)) twice in the compiled backward — once as its own small fusion, once recomputed inside the fusion that evaluates the ∂‖z‖ branch — and its per-process fusion autotuner picks the emitter for the first one by measured runtime, NATIVE_EMITTER or BLOCK_LEVEL_EMITTER (Triton). The two emitters disagree in the last bit of n for some rows; when they do, [n == ans] is false for that row, the derivative factor becomes 0, and the gradient returned for that output channel is exactly the one you would get by treating ‖z‖ as a constant. Measured on an A100 (jax 0.9.1, linear_plfc layer-contract inputs, float32 vs a float64 reference): jitted gradient relative error 1.0e-2 → 1.5e-7, and in a failing launch the affected row matched the ‖z‖-frozen gradient to 2.5e-8 while every other row was correct to 1.5e-7 — the branch was dropped, not perturbed. The reduced repro failed in 5 of 8 launches before and passed 7 of 7 after; test_gradient_contract[linear_plfc-f32] failed in 3 of 4 pytest launches before and passed 3 of 3 after. This was not conditioning: perturbing ‖z‖ by one float32 ulp in float64 — coherently, or independently at each of its three occurrences in the formula — moves the true gradient by at most 2.4e-7, five orders of magnitude short of the observed error. The floor is now jnp.where(n > min_enorm, n, min_enorm), which compares n against the constant (0.027 vs 1e-15 at these inputs) instead of against a differently-rounded copy of itself, so no 1-ulp disagreement can flip it. Forward values and the CPU gradient are bit-identical before and after in both dtypes, eager and jitted; only a NaN z behaves differently (maximum propagates the NaN, where floors it), which is already outside the function's contract. Flooring the squared sum instead (sqrt(maximum(Σz², eps²))) does not help — it keeps the same maximum tie-break and still failed 4 of 6 launches. The three XLA flags that hid the symptom (--xla_gpu_enable_cublaslt=false, --xla_gpu_autotune_level=0, --xla_gpu_enable_triton_gemm=false) each did so only by removing the emitter choice, not by fixing anything. The same hazard applies to every jnp.maximum(f(x), floor) on a differentiated path — the library has ~30 such MIN_NORM floors — but only this one has been observed to fire; a pure-JAX repro and a draft upstream report are in logs/2026-09-03_plfc_jit_grad/upstream/
  • The same GPU gradient-zeroing hazard is now closed at every other constant floor and clamp in the library — 76 sites. The mechanism is the one in the entry above: jnp.maximum(f(x), CONST)'s JVP is jax's _balanced_eq, which tests the operand for bit equality with the result, and XLA:GPU may compute the operand twice with emitters chosen per process by its fusion autotuner. When the two copies disagree by 1 ulp the whole gradient branch through the operand is silently zeroed. Only the MLR site had been observed to fire, but every constant floor on a differentiated path is exposed, so all of them are rewritten as a comparison against the constant, through three new one-line helpers in hyperbolix.utils.math_utils: floor_at(x, lo) = where(x < lo, lo, x), cap_at(x, hi) = where(x > hi, hi, x), and clamp_to(x, lo, hi) = cap_at(floor_at(x, lo), hi). The comparison direction is chosen so a NaN operand still propagates exactly as maximum/minimum/clip propagated it (NaN < lo is false, so the NaN is selected), which makes the forward value identical for every input — finite, NaN, and ±inf — at all 76 sites, in both dtypes, eager and jitted. Converted: the whole of manifolds/ (hyperboloid 23, poincaré 6, gyrovector core 8, stereographic 4, proper velocity 2, product 1, isometry mappings 3), distributions/ (2), decomposition/ (9), utils/ (8), and nn_layers/ (10). Deliberately not converted (9 sites): the smooth_clamp family, where the 0.5/0.5 tie split is the analytic derivative; safe_hypot's scale, which is under stop_gradient; the two genuine elementwise min/max in get_delta's Gromov-product scan; and the two floors on non-differentiated paths (uniform-Poincaré direction sampling, Busemann weight-norm init). Two behavioural differences, both improvements, both from the fact that a where's VJP is a select rather than a multiply by a 0/1 factor: (1) _compute_mlr's NaN behaviour reverts — the where landed in the previous entry used the > direction, which floored a NaN z; it now uses floor_at, i.e. <, restoring the NaN propagation the original .clip(min=…) had. (2) A saturated sinh/cosh/tanh argument no longer leaks 0 * inf = NaN into a squared downstream gradient: grad((sinh∘clip)(x)²) past the overflow clamp was NaN in both dtypes and is now exactly 0. That is what test_smooth_clamp_vs_clip.py::test_saturated_tail_gradient_is_degenerate_for_both_clamps pins as a negative property, and its own docstring says to re-baseline it if it ever improves — it now needs that re-baseline (two assertions, both dtypes). Bit-identity was verified on CPU against the parent commit over 13 144 forward and gradient blob comparisons on 3 286 cases — every public method of Poincare, Hyperboloid, Euclidean, ProperVelocity, Stereographic and ProductManifold, both MLR helpers, the isometry maps, the hyperboloid_core/busemann_core functional cores and HypRegressionPoincare, over near-origin, ordinary and near-boundary/large-radius inputs plus exact-zero, exact-MIN_NORM, exact-±1, NaN and ±inf rows
  • Both hyperbolic MLR heads returned an all-NaN gradient — for the whole kernel, not just the affected class — as soon as one hyperplane normal was exactly zero. manifolds/hyperboloid._compute_mlr and nn_layers/poincare_regression.HypRegressionPoincare._compute_mlr divide by the Euclidean norm of the per-class normal and floor that norm. The floor keeps the forward value finite, but jnp.linalg.norm's VJP at the zero vector is z/‖z‖ = 0/0 = NaN, created inside the norm's own VJP — where the floor's zero cotangent meets it as 0 * NaN = NaN, so the NaN spreads to every row of the kernel gradient. An exactly-zero normal is an ordinary input (a dead or pruned output channel, or a zero-initialised head), and it was silently fatal: measured NaN in all 8 combinations of {hyperboloid MLR, Poincaré regression} × {float32, float64} × {eager, jitted}. Both now use the library's safe_norm, whose double-where gives an exact 0 value and an exactly-zero VJP at the zero vector; the floor_at guard stays in front of the division. After the fix all 8 are finite, the Poincaré head's dead row gets an exactly-zero gradient, and the hyperboloid head's dead row is inert at the min_enorm scale (max |g| 1.8e-15 float32 / 3.0e-15 float64 against ~10 for the live rows — the residual is the genuine d⟨x_s, z⟩ path, not the norm). This is the one change in this release that is not bit-identical for ordinary inputs: safe_norm is max-scaled (it divides by max|v| before squaring, which is what makes it overflow-free past ‖z‖ = 1.8e19 in float32), so the norm itself moves. Measured against a float64 reference over 20 000 vectors per cell, dims 2/8/64 and scales 1e-8/1/1e3: the norm moves by at most 2–4 ulp, and safe_norm's own error is at most ~1 ulp worse than linalg.norm's on in-range inputs (float32 max 3.2 vs 2.5 ulp, mean 0.48 vs 0.42). Downstream the alpha = -x₀·sinh(√c·r)·‖z‖ + cosh(√c·r)·⟨x_s, z⟩ cancellation amplifies that, so the MLR forward and gradient move by up to 3.6e-7 relative to each array's own scale in float32 (≈3 ulp of scale) and 6.1e-16 in float64. Accuracy is unchanged: float32-vs-float64 relative error of the forward and of grad(Σ res²) is the same before and after to within noise across c ∈ {0.3, 1} × spatial scale ∈ {1e-8, 0.5, 8} (forward 1.5e-7…2.5e-7 both; the pre-existing 1.1e-1 float32 blow-up at c = 1, radius 8 is present in both and is a separate large-radius limitation). A bit-identical alternative exists — wrapping jnp.linalg.norm in the same double-where by hand — and was not taken, because safe_norm is the library's own primitive for exactly this and additionally removes the sum(z²) overflow at large radius
  • Pairwise hyperboloid dist/sqdist/logmap lost eps·x₀ in the radial term of their polar decomposition, an O(eps/r) relative error near the origin; the gap is now built from the spatial radii. _polar_frame needs P = sinh((a−b)/2) = ½·(u_x − u_y)/(√u_x·√u_y) with u = x₀ + ‖x_s‖. Forming u_x − u_y directly subtracts two numbers of size x₀ ≈ 1/√c to obtain a difference of size ‖x_s‖ − ‖y_s‖, and x₀ is only stored to eps·x₀, so near the origin the difference is mostly rounding. It is now evaluated through the on-sheet identity x₀ − y₀ = (r_x² − r_y²)/(x₀ + y₀), i.e. u_x − u_y = (r_x − r_y)·(1 + (r_x + r_y)/(x₀ + y₀)) with r = ‖x_s‖: only the spatial radii enter the subtraction (exact by Sterbenz when they are close) and the bracket is a ratio of sums of positive numbers running from 1 at the origin to 2 at large radius, so it can neither cancel nor overflow. u_x, u_y still supply the √u_x·√u_y denominator and the isfinite guard that returns ±inf past the representable radius, so behavior there is unchanged. Relative error against a 250-digit Decimal reference evaluated on the dtype-rounded spatial parts, worst over c ∈ {0.3, 1, 2.5} and dim ∈ {8, 32}, median (max), before → after (logs/2026-09-03_polar_frame_gap/probe_polar_gap_accuracy.py, CPU backend, jax 0.9.1; the A100 agrees in every cell to within float32 rounding noise — its worst new-column value on the origin grid is 2.7e-7 against 3.1e-7 on CPU) — float32 dist(origin, x): 1.0 (1.0) → 1.8e-7 (2.8e-7) at spatial radius 1e-8, 4.6e-2 → 1.9e-8 (1.3e-7) at 1e-6, 1.4e-4 → 9.5e-8 (2.4e-7) at 1e-4, 3.1e-5 → 2.4e-7 (2.6e-7) at 1e-3, 9.7e-6 → 1.7e-7 (2.6e-7) at 1e-2, 9.7e-7 → 1.5e-7 at 0.1; float32 dist(x, y) for two points at geodesic radius 1e-3 separated by 1e-3: 3.0e-5 → 1.7e-7, at radius 0.1 separated by 1e-3: 2.0e-5 → 1.5e-6; float64 at radius 1e-3 separated by 1e-5: 1.3e-12 → 3.2e-15. No cell at large radius regresses: over the whole (geodesic radius 1 … 40) x (separation 1e-4·r … 10·r) grid every cell that gets worse does so within ulp noise — worst new/old median ratio 1.6 on a CPU float64 cell whose median relative error is 2.7e-15, 3.0 on a GPU float64 cell that moves from 1 to 3 ulp (1.1e-16 → 3.3e-16), 1.3 on a float32 cell at 1.1e-7 — plus one float32 cell sitting at 2e-4 where both arms are input-resolution-limited (ratio 1.1 CPU, 0.7 GPU); every cell at radius ≥ 10 (float32) / ≥ 20 (float64) reproduces the old median and max unchanged. dist(x, y) == dist(y, x) stays exact to the bit: r_x + r_y and x₀ + y₀ are unchanged under the swap and r_y − r_x is the exact negation of r_x − r_y. Consumers: dist, sqdist, logmap (its cos φ reads P/S from the same frame), and tangent_norm via logmap. Supersedes the sentence in the dist_0/logmap_0 entry above that calls this "a planned separate change" and advises dist_0 over dist(origin, x) — the two now agree to 3.1e-7 in float32 at every radius, though dist_0 remains marginally tighter because the MIN_NORM floor on ‖y_s‖ at the origin leaves a ½·MIN_NORM/‖x_s‖ relative residual in the pairwise arm (5e-12 at radius 1e-4, invisible in float32)
  • Poincare.dist_0(..., version_idx=2) (VERSION_METRIC_TENSOR) was floored to one constant, acosh(1 + 10·eps)/√c ≈ 1.5e-3/√c, for every float32 radius below ~7.7e-4/√c, and to exactly zero for every float64 radius below 2.2e-8/√c; it now uses the algebraically identical arcsinh half-angle form. The arm evaluated acosh(1 + 2c‖x‖²/(1 − c‖x‖²))/√c, the same defect class as the hyperboloid's old acosh(√c·x₀) route: the entire radial signal sits in a perturbation of a leading 1, so math_utils.acosh's 1 + 10·eps domain clamp flattened everything below sqrt(5·eps/c) onto that constant, and an extra arg < 1 + MIN_NORM short-circuit zeroed a second band below sqrt(MIN_NORM/2c) (in float64 only: in float32 1 + MIN_NORM rounds to 1). The identity acosh(1 + 2t) = 2·arcsinh(√t) moves the radius into an argument linear in r: with t = c‖x‖²/(1 − c‖x‖²) the arm is 2·arcsinh(√c‖x‖/sqrt(1 − c‖x‖²))/√c, which needs no domain clamp at all. Median relative error vs a 60-digit decimal reference, dim 8, before → after (CPU jax 0.9.1; the A100 agrees), float32: r=1e-8 7.7e4 → 1.4e-8, 1e-6 7.7e2 → 1.4e-8, 1e-4 6.7 → 2.9e-8, 1e-3 6.6e-3 → 5.3e-8, 1e-2 3.3e-5 → 8.6e-8, 0.1 4.9e-7 → 3.4e-8, 0.9/√c 6.5e-8 → 3.5e-8 (all at c = 1; c = 0.3 and 2.5 differ only in the floored magnitude, up to 1.4e5 at r=1e-8); float64: 1e-8 1.0 → 1.7e-16, 1e-6 1.1e-5 → 0, 1e-4 2.5e-9 → 1.4e-16, 1e-3 2.8e-12 → 0, 1e-2 1.4e-13 → 0, 0.1 2.2e-15 → 0. The jax.grad magnitude in the floored band was exactly 0 instead of the analytic 2 (float32 r ≤ 1e-6 at every curvature, r ≤ 1e-3 at c = 0.3; float64 r ≤ 1e-8), so a parameter optimised through slot 2 near the origin received no gradient at all. Not a new version slot: slot 2 is the metric-tensor distance and it is the same function, now computed accurately. The boundary guard is untouched — 1 − c‖x‖² still comes from the clamped conformal factor, so the representable ceiling stays 12.1/√c (float32) / 27.8/√c (float64) — and safe_norm supplies the exactly-zero value and VJP at the origin, so d₀(0) = 0 and jax.grad there are both unchanged (logs/2026-09-03_poincare_origin_numerics/probe_item1_metric_tensor_dist_0.py). Slots 0 and 1 were never affected
  • The pairwise Poincare.dist(..., version_idx=2) (VERSION_METRIC_TENSOR) had the same floor as its dist_0 twin: two points closer than ~1.2e-3/√c in float32 came back at exactly 0 distance with an exactly-zero gradient. The arm evaluated acosh(1 + 2t)/√c with t = c‖x - y‖²/((1 - c‖x‖²)(1 - c‖y‖²)), so math_utils.acosh's 1 + 10·eps domain clamp flattened every pair with t < 5·eps onto zero and an arg < 1 + MIN_NORM short-circuit zeroed a second band below t = MIN_NORM/2. The two (1 - c·r²) factors scale the threshold with the pair's radius: at c = 1 the float32 separation floor is 1.2e-3 at the origin and 9.2e-4 at radius 0.5. It is now the identical half-angle form 2·arcsinh(√t)/√c, √t = √c‖x - y‖/sqrt((1 - c‖x‖²)(1 - c‖y‖²)), whose argument is linear in the separation. Median relative error vs a 60-digit decimal reference routed through Möbius addition (independent of the formula under test), dim 8, c = 1, before → after — float32 at radius 1e-2: separation 1e-8 7.7e4 → 3.0e-8, 1e-6 7.7e2 → 2.6e-8, 1e-4 6.7 → 2.3e-8, 1e-2 6.7e-5 → 1.0e-7; at radius 0.5: 1e-8 3.5e4 → 3.6e-8, 1e-6 5.8e2 → 3.3e-8, 1e-4 4.8 → 4.5e-8, 1e-2 2.6e-6 → 6.1e-8. float64 at radius 1e-2: 1e-8 1.0 → 1.7e-16, 1e-6 5.4e-8 → 2.1e-16, 1e-4 2.5e-9 → 6.8e-17, 1e-2 1.9e-13 → 0; at radius 0.5: 1e-8 1.0 → 1.2e-16, 1e-6 6.3e-6 → 0, 1e-4 3.6e-10 → 0. At c = 0.3 and 2.5 only the floored magnitude differs (up to 1.4e5). 23 of 60 probed gradient cells returned an exactly-zero gradient and now return the analytic λ(y) = 2/(1 - c‖y‖²) — a loss pulling two nearby points apart through slot 2 received no gradient at all. safe_norm on x - y keeps dist(x, x) exactly 0 with a finite (zero) gradient, which is what the removed where-guard used to provide (test_precision.py::test_poincare_dist_grad_at_coincident_points). Both boundary guards are unchanged — the two 1 - c‖·‖² factors still come from the clamped conformal factors — and this is not a new version slot: slot 2 is the metric-tensor distance and it is the same function, now computed accurately (logs/2026-09-03_poincare_origin_numerics/probe_item5_metric_tensor_dist_pairwise.py). Slots 0 and 1 were never affected
  • Hyperboloid.logmap_0 returned an all-NaN vector for a point with an infinite spatial entry, wiping out the time slot too; it now returns ±inf on the infinite entries. safe_norm deliberately passes an inf through as inf so an out-of-range point stays visibly degenerate, which made u = √c·‖y_s‖ = inf and the scale arcsinh(u)/u an inf/inf NaN that then multiplied every spatial entry. The pairwise dist / _polar_frame convention for an out-of-range input is ±inf, not NaN, and logmap_0 now matches it: scale = where(isfinite(u), arcsinh(u)/u, 1), so an infinite entry comes back as ±inf with its sign, the finite entries keep their own values, and the time slot stays exactly 0 — the right limit, since the tangent vector toward an infinitely far point has infinite norm and its direction is the unit vector along the infinite coordinate. NaN in still gives NaN out, but only in the NaN entry rather than across the whole vector. The guard is a where on the scalar u, so the finite path is unchanged. Over 2000 log-spaced spatial magnitudes 1e-20…1e10 in both dtypes the forward value is bit-identical on both backends (0 of 18000 bit patterns), and the gradient is bit-identical on XLA:CPU; on XLA:GPU the gradient moves by at most 2 ulps on 614 (float32) / 626 (float64) of 18000 entries, because the extra where changes how XLA:GPU fuses the VJP. That is below the 4-ulp spread the unchanged code already shows between the two backends (4294 of 18000 float32 gradient entries differ CPU-vs-GPU before the change), and each backend is deterministic run to run (logs/2026-09-03_poincare_origin_numerics/probe_item2_logmap_0_inf.py)
  • Every additive-epsilon norm in the library is gone: sqrt(sum(x**2) + MIN_NORM**2) overflowed float32 above coordinate 1.8e19 and floored every genuinely small vector at 1e-15. The idiom was a gradient guard — it gives sqrt a finite derivative at x = 0, which jnp.linalg.norm does not (its VJP there is 0/0 = NaN) — and it paid for that at both ends of the exponent range. Overflow: Hyperboloid.proj at float32 spatial radius 5e19 returned x0 = inf, and already at 1e19 its Minkowski residual -x0² + ‖x_s‖² evaluated to exactly 0 instead of -1/c; expmap_0 inherited both through its trailing _proj. The Poincaré ball's boundary clamp failed the same way but louder: with ‖x‖ = inf the clamp x·(max_norm/‖x‖) is the zero vector, so a float32 point at radius 1e20 was projected onto the origin rather than onto the boundary (measured ‖proj(x)‖ = 0.0; it is now 0.99999). pv_to_poincare and pv_to_hyperboloid had the same ceiling on dot(x, x). Underflow: the +MIN_NORM² = 1e-30 floor dominates any genuinely small vector, relative residual MIN_NORM²/(2r²) — Poincare.dist_0 of a float32 point at radius 1e-15 returned 2.83e-15 for a true 2.00e-15 (41 % high, and every smaller radius collapsed onto that same value), and a float64 point at radius 1e-8 was 5.0e-15 high. 59 sites across manifolds/, nn_layers/ and distributions/ now use safe_norm / safe_hypot / the new safe_sqrt — 47 here and 12 more on the hot path, split into their own commit so the kernel cost can be reverted independently — and no occurrence of the old idiom is left in the package. 36 floors that bound a value rather than a derivative (Minkowski forms, conformal factors, explicit divisor guards, BatchNorm and Adam epsilons) are deliberate and unchanged, each with its reason in logs/2026-09-03_safe_norm_sweep/inventory.md. One consequence had to be undone: the old idiom's sqrt(jnp.sum(x**2) + eps) reduces every axis, so on the (B, dim) arrays several call sites hand these single-point ops it produced a scalar that broadcast (against the whole batch, i.e. a Frobenius norm — silently not a per-row one), while safe_norm reduces only the last axis and the (B,) result no longer broadcasts at all; 14 norms that scale a (..., dim) operand get the trailing axis back as [..., None] (_gyrovector_core._proj, Poincare._expmap/_expmap_0, six Stereographic maps plus _geodesic_unit/_antipode, and ProperVelocity._scalar_mul/_expmap_0/_logmap_0/_logmap), and Poincare._scalar_mul/_logmap_0 take axis=-1, keepdims=True on their whole-array jnp.sum for the same reason. Bit-identical on the single-point contract (8100 evaluations across 5 manifolds × 15 ops × 2 dtypes × dims 2/5/12 × 3 curvatures × 6 seeds — 0 value and 0 shape differences) and free (A100 kernel/reduction counts unchanged on all five probed ops); on a batched input every one of them is now exactly the per-row result, which tests/test_class_based_manifolds.py::test_implicitly_batched_call_equals_the_per_row_call pins. A second consequence is now gone too, and it cost accuracy rather than shapes: the rescaling divided by max|v| itself, which is an inexact division, so the result carried 1–2 ulp that the old sqrt(sum(v**2) + eps) did not — visible wherever a caller recomputes the same sum of squares, as the hyperboloid does (x₀ = sqrt(‖x_s‖² + 1/c) checked against -x₀² + ‖x_s‖² = -1/c, where at x₀ ≈ 34 in float32 one ulp of x₀² is 1.2e-4, larger than the 1e-4 tolerance the HRC norm layers are checked at). The divisor is now the exact power of two just below max|v| (jnp.frexp/jnp.ldexp), which shifts the exponent and nothing else, so it contributes no rounding of its own: over magnitudes 1e-15…1e15 (float32) and 1e-30…1e30 (float64), dims 2/4/16/64, safe_norm matches a jitted sqrt(sum(v**2)) on all but 1 of 480 000 values, against 67 239 of 160 000 for the divide-by-max form. Bit-identity is not unconditional and is not claimed to be: which association XLA gives a last-axis reduction depends on the surrounding fusion, and at dim 8 the two programs happen to differ by 1–2 ulp (mean 0.13–0.17) where at dims 2/4/16/64 they agree exactly — the divide-by-max form is 1–3 ulp with mean 0.34–0.62 at every dim. The overflow-free property is untouched (a float32 vector at radius 1e20 still returns 2.83e20, not inf). The other half of the accuracy loss was the shape of the two-leg reconstruction: safe_hypot(safe_norm(v), q) rounds ‖v‖ and squares it again, which is up to one ulp of sum(v**2) and cannot cancel. A new hyperbolix.utils.safe_hypot_norm(v, q) computes sqrt(‖v‖² + q²) in one reduction, reproducing the association of the sqrt(sum(v**2) + q**2) it replaces, and the nine sites that reconstruct a hyperboloid time slot or an epsilon-floored norm use it (Hyperboloid._proj/_proj_batch, isometry_mappings.pv_to_hyperboloid, hyperboloid_core.spatial_to_hyperboloid/build_spacelike_V, both hyperboloid_linear reconstructions, both hyperboloid_attention norms). The Minkowski residual of HRCBatchNorm/HRCRMSNorm at c_in = 10 -> c_out = 0.1 goes 6.1e-5/3.1e-5 (pre-sweep) -> 1.5e-4/1.2e-4 (sweep, both over the 1e-4 tolerance) -> 6.1e-5/6.1e-5. All 11 probed A100 ops are unchanged in kernels and reductions, so both halves are free. The three sqrt(1 + c‖x‖²) sites — ProperVelocity._beta_inv, its _compute_mlr twin and isometry_mappings.pv_to_poincare — are converted too, as safe_hypot_norm(√c·x, 1). Measured against an 80-bit longdouble reference over c ∈ {0.3, 1, 2.5}, dims 2/8/16, both dtypes and radii 1e-3…1e3, that is the most accurate of the three overflow-free spellings: mean 0.25 ulp / max 2 and exact on 75.0 % of values, against 0.32 / max 3 / 69.5 % for the two-leg safe_hypot(1, √c·safe_norm(x)) it replaces and 0.30 / max 3 / 70.8 % for the variant that scales the scalar leg (√c·safe_hypot_norm(x, 1/√c), exact at c = 1 but 0.45 ulp at c = 2.5 in float64, where 1/√c is itself inexact). Scaling the components cannot overflow where the result does not, since 1/β_x ≥ √c·‖x‖ ≥ √c·max|xᵢ|: at float32 radius 1e20, _beta_inv is 1.55e20/2.83e20/4.47e20 at those three curvatures and pv_to_poincare lands the point exactly on the ball boundary 1/√c, with a finite (zero) gradient at the origin
  • Four norms had no guard at all and returned a NaN gradient at the zero vector: Euclidean.dist, Euclidean.dist_0, Euclidean.tangent_norm and ProperVelocity.tangent_norm, plus all three ProductManifold methods that call them. The first three were bare jnp.linalg.norm, whose VJP at the zero vector is 0/0 = NaN; ProperVelocity.tangent_norm and ProductManifold.tangent_norm were sqrt(floor_at(g_x(v,v), 0.0)), where sqrt'(0) = inf meets a zero cotangent as 0·inf = NaN. Measured on the parent (logs/2026-09-03_safe_norm_sweep/parent_gate/gate.py): grad(Euclidean.dist_0)(0), grad(Euclidean.dist)(x, x), grad(ProperVelocity.tangent_norm)(0) and ProductManifold.dist_0 / dist / tangent_norm at the product origin all returned all-NaN (the product cases NaN only in the Euclidean factor's slots, poisoning the sum). All six now return exactly zero — the finite, direction-free choice where the derivative does not exist. Reachable from any model with a Euclidean factor in a product manifold, or any Riemannian-norm regulariser evaluated at a dead unit
  • A new hyperbolix.utils.math_utils.safe_sqrt, the scalar counterpart of safe_norm: sqrt(x) with the same double-where, so the derivative at x == 0 is exactly 0 rather than inf. For the quantities that arrive already squared — Minkowski and Riemannian forms g_x(v, v), sums of per-factor squared distances — which safe_norm cannot take (its input is the vector, and a Minkowski form is not a Euclidean norm). Exported from hyperbolix.utils

  • Hyperboloid.proj returned an infinite time coordinate for any float32 point past spatial radius 1.8e19, and a Minkowski residual of exactly 0 instead of -1/c just below it. x₀ = sqrt(floor_at(1/c + dot(x_s, x_s), MIN_NORM)) forms the sum of squares, which overflows float32 as soon as a spatial coordinate passes 1.8e19 — while ‖x_s‖ itself, and therefore x₀, is a perfectly ordinary float. Measured on the parent at c = 1 (logs/2026-09-03_safe_norm_sweep/parent_gate/gate.py): radius 5e19 and 1e20 give x₀ = inf; radius 1e19 gives a finite x₀ = 1e19 whose constraint -x₀² + ‖x_s‖² evaluates to 0.0 rather than -1.0, because sqrt of the (still finite) sum has lost the 1/c entirely. expmap_0 inherited both through its trailing _proj — a tangent vector of length 1e19 came back as [inf, 7.0e37, 0, 0]. It is now the two-leg safe_hypot(1/√c, safe_norm(x_s)), which never materialises ‖x_s‖²: the constraint holds to 1e-6 relative (checked in float64 against the float32 output) at every radius from 1e19 to 1e20, in proj, proj_batch and expmap_0. Dropping the MIN_NORM floor is a no-op on the finite domain — 1/c + ‖x_s‖² ≥ 1/c > 1e-15 for every curvature below 1e15 — and lets a non-finite input pass through as inf, the convention safe_norm and the pairwise dist already follow. nn_layers carried three copies of the same sqrt(‖z‖² + 1/c) reconstruction (_fhcnn_forward, _fgg_linear_forward, hyperboloid_core.spatial_to_hyperboloid) and isometry_mappings.pv_to_hyperboloid a fourth; all four are converted

  • The Poincaré ball's boundary clamp projected the farthest representable point onto the origin. _gyrovector_core._proj computes where(‖x‖ > max_norm, x·(max_norm/‖x‖), x) with the same overflowing sqrt(sum(x**2) + MIN_NORM**2). Past float32 coordinate 1.8e19 that norm is inf, so the scale factor is max_norm/inf = 0 and the clamp returns the zero vector — the point farthest from where it belongs. Measured on the parent: ‖proj(x)‖ = 0.0 at radius 1e20 (it is 0.99999, i.e. max_norm, at 1e19, where the norm has not yet overflowed). It is now floor_at(safe_norm(x), MIN_NORM): the floor stays, because norm divides in the untaken branch of the where as well and a zero cotangent against that branch's inf is NaN. _proj_batch had the same defect and the same fix
  • ProperVelocity._beta collapsed to 0 for any point past ‖x‖ = 1.8e19/√c. 1/sqrt(1 + c·dot(x, x)) overflows the same way, and _beta is the coefficient every PV gyro-operation is built from — _addition, _expmap, _logmap, _dpi_x, _tangent_inner — so one overflowing coordinate silently zeroed all of them. ‖x‖ = 1.8e19 is geodesic radius arcsinh(1.8e19) ≈ 45, well inside the range PV exists to serve: it is the unconstrained model, chosen precisely because it stays stable where the ball saturates. _beta_inv is now safe_hypot(1, √c·safe_norm(x)) and _beta its reciprocal; isometry_mappings.pv_to_poincare had the same expression and the same fix (there the overflow mapped a far-out PV point to the ball origin)
  • The FHNN linear/conv forward returned an all-inf spatial row for any float32 time coordinate past y0 = 1.844e19. _fhnn_forward recovered the target spatial norm from the hyperboloid constraint as sqrt(y0**2 - 1/c), and y0**2 overflows float32 at sqrt(FLT_MAX) = 1.844e19 — a regime capped_exp deliberately allows y0 to reach, since it caps a runaway scale at exp(0.99·log(FLT_MAX)) ≈ 6.1e37 precisely so the value stays finite. Measured on the parent (logs/2026-09-04_flags_batch/probe_diff_of_squares.py, c = 1): y0 = 1e20 gives [1.0e20, inf, -inf, inf] and d‖y_s‖/dy0 = 0 instead of 1. It is now the factored difference of squares sqrt(y0 - 1/√c) · sqrt(y0 + 1/√c), whose two factors are each strictly positive because y0 > 1/√c + eps holds by construction (additive floor, not a max): finite through y0 = 3e38, with ‖y_s‖/y0 → 1 to 1e-6 relative and finite gradients. This is the difference-of-squares counterpart of the safe_hypot sum-of-squares conversion above, and it was the one remaining site of its kind in the library. Values are not bit-identical in float32. Over a margin-stratified grid (y0 - 1/√c from 1e-2 to 1e19, c in {0.25, 0.5, 1, 2, 5}, logs/2026-09-04_flags_batch/probe_ordinary_range.py) the two forms differ by at most 3.1e-6 relative, at the smallest margins; above margin 1 it is 1-2 ulps. Where they disagree materially the factored form is the more accurate of the two against a float64 reference (worst case 1.3e-6 vs the old form's 2.9e-6 at margin ≤ 1); in the large-margin bands the old form is exact and the new one carries 1 ulp

Changed

  • The hot-path half of the norm conversion (proj, proj_batch, expmap_0, logmap_0 on every manifold, plus the Proper-Velocity _beta/_beta_inv/_safe_norm helpers) is a separate commit, and it costs one XLA kernel. Compile-only counts for jax.jit(jax.vmap(op)) at batch 1e7, dim 32, float32 on an A100 (jax 0.9.1, logs/2026-09-03_safe_norm_sweep/probe_xla_kernels.py, kernels/reductions, before -> after): Poincaré expmap_0 3/1 -> 5/2 and proj 3/1 -> 5/2; hyperboloid proj 1/1 -> 2/2, expmap_0 2/2 -> 3/3, and addition 7/8 -> 9/9 (it calls proj). Unchanged: Poincaré dist 2/4, logmap_0 3/1, mobius_add 3/5, ptransp 3/5, and hyperboloid logmap_0 3/2, dist 6/6. The extra reduction is the max|x| that max-scaling needs, and it is unavoidable here: these are exactly the sites whose input is by definition unprojected, so the overflow they fix is reachable and the cheap safe_sqrt spelling used elsewhere would not fix it. Reverting this commit alone restores the old kernel counts and leaves the other 47 conversions in place.

  • The additive-epsilon norm replacement moves float32 values by 1-3 ulps and is free on GPU. Which primitive replaces which site is a cost decision: safe_norm's max-scaling costs a second reduction over the input, so it is used only where the input magnitude is genuinely unbounded (tangent vectors, unprojected points, hyperboloid/PV coordinates, layer weights). Where the argument is a ball point — Poincare.dist, dist_0, logmap, scalar_mul, the Apollonian metric — sum(x**2) <= 4/c and overflow is unreachable, so those use safe_sqrt(sum(x**2)), the same double-where on the scalar. Compile-only kernel counts for jax.jit(jax.vmap(op)) at batch 1e7, dim 32, float32 on an A100 (jax 0.9.1, logs/2026-09-03_safe_norm_sweep/probe_xla_kernels.py): every one of the 11 probed ops is unchanged in both kernels and reductions — Poincaré dist 2/4, expmap_0 3/1, logmap_0 3/1, mobius_add 3/5, ptransp 3/5, proj 3/1; hyperboloid proj 1/1, expmap_0 2/2, logmap_0 3/2, dist 6/6, addition 7/8. (Spelling Poincare.dist's numerator safe_norm instead would have cost it 2 -> 4 kernels and 4 -> 5 reductions for an overflow that cannot happen there; that measurement is in the same log directory.) One subtlety the conversion has to respect: where a floored norm feeds a sinh(t)/t, the floor belongs on t itself and not only on the denominator, or the ratio is 0 instead of 1 at t = 0

  • The pairwise dist gap term reads x₀ only through a well-conditioned sum, so the spatial part is now the source of truth for the radial split too. For an input that is off the sheet, dist/sqdist/logmap now report the gap implied by its spatial radii — the same convention proj (which rebuilds x₀ from x_s), dist_0 and logmap_0 already follow — rather than one read off an x₀ inconsistent with them. On-sheet inputs are unaffected beyond the accuracy change above. A raw jax.grad(dist) correspondingly moves its radial support from the time slot to the spatial slot; the two gradients differ by a multiple of the constraint normal, so after egrad2rgrad/tangent_proj the Riemannian gradient is unchanged and the Riemannian optimizers are unaffected. Measured over 75 (curvature x radius x radius) cells, CPU and A100 alike (logs/2026-09-03_polar_frame_gap/probe_polar_gap_gradient.py): worst old-vs-new relative disagreement 3.6e-14 (float64) and 4.3e-7 median / 3.7e-5 worst (float32); in the three float32 cells above 1e-5 the old arm is the one that moved — against the same pair promoted to float64 the new gradient is within 1.1e-6 while the old carries the full 3.7e-5
  • Breaking: dist_0(..., version_idx=2) and version_idx=3 now return the pre-fix acosh arms. Those two slots used to duplicate slots 0 and 1 for the origin distance; they now select VERSION_LEGACY / VERSION_LEGACY_SMOOTHENED, mirroring what they have meant for the pairwise dist since 1.1.2, and exist only to reproduce results computed before this fix. Code that passed 2 or 3 to dist_0 and expected default behavior must pass VERSION_DEFAULT (0) or VERSION_SMOOTHENED (1)
  • dist_0 and logmap_0 read the radius off x_s and ignore x₀. An off-sheet input therefore gets the radius of its proj projection, which is the convention proj itself follows (it rebuilds x₀ from x_s) and what ProperVelocity.dist_0 already did. A raw jax.grad(dist_0) consequently has its support on x_s instead of on x₀; the two gradients differ by a multiple of the constraint normal, so after egrad2rgrad/tangent_proj the Riemannian gradient is identical and the Riemannian optimizers are unaffected
  • Poincare.expmap_0 clamps the boundary on the scalar instead of re-projecting its output. It now computes t = min(tanh(√c·‖v‖), √c·max_norm) and res = t/(√c·‖v‖) · v, so ‖res‖ ≤ max_norm holds by construction and the trailing proj (a second norm reduction over the op's own output) is gone. Under jax.jit(jax.vmap(...)) at batch 1e7, dim 32 the op compiles to 3 kernels with 1 reduction instead of 5 with 2 (logs/2026-09-02_submission-numerics/probe_xla_kernels.py, A100, jax 0.9.1 and 0.11.0). Values move only on rows the projection clamps (‖v‖ ≳ 8/√c in float32): at most 3.4e-7 relative (float32, c ≤ 5) / 6.0e-16 (float64), overshooting max_norm by at most 2.2 eps, 50x inside the eps**0.75 margin; Jacobians agree on unclamped rows. _gyrovector_core._max_norm is the factored bound; proj itself is unchanged bit-for-bit.
  • Möbius addition x ⊕ y computes its own output norm from reductions over the inputs, so the boundary clamp is a scalar comparison instead of a second pass over the result. _gyrovector_core._addition used to build num = A·x + B·y (A = 1 + 2c⟨x,y⟩ + c‖y‖², B = 1 − c‖x‖²) and call proj(num/denom, c), which reduces ‖·‖ over the op's own (dim,) output. It now regroups the numerator as num = B·(x+y) + c‖x+y‖²·x — identical in exact arithmetic, since A − B = c‖x+y‖² — and expands ‖num‖² = B²·s2 + 2·B·(c·s2)·⟨x,s⟩ + (c·s2)²·‖x‖² with s = x+y, s2 = ‖s‖², in the same two coefficients that built num. Five input reductions (‖x‖², ‖y‖², ⟨x,y⟩, s2, ⟨x,s⟩) replace three plus one output reduction. Under jax.jit(jax.vmap(...)) at batch 1e7, dim 32, float32 the op compiles to 3 kernels / 5 reductions / 5 (B, dim)-sized memory passes, from 5 / 4 / 7 — XLA folds all five reductions into a single multi-output kInput fusion and the unprojected (B, dim) intermediate, which previously had to be written and read back, is gone (logs/2026-09-02_submission-numerics/probe_xla_kernels.py, A100, jax 0.9.1; dist stays 2 / 4 and expmap_0 3 / 1). H100 timing pending — run logs/2026-09-02_submission-numerics/probe_gpu_timing.py. The regrouping is what makes the analytic norm safe, and it is not interchangeable with the textbook ‖num‖² = A²‖x‖² + 2AB⟨x,y⟩ + B²‖y‖². Take x near the boundary, ε := 1 − c‖x‖², and y = −x + n: A·x and B·y are each of size ε‖x‖ but their sum is O(ε²), so every norm derived from A and B is a difference of terms 1/ε² larger than its own value, and the floating-point vector fl(A·x) + fl(B·y) itself differs from the exact A·x + B·y by a relative eps/ε — which means the clamp can scale a row to sit outside the ball even when the norm formula has no cancellation of its own. B·(x+y) and c‖x+y‖²·x are individually the same order as their sum (cancelling only in the collinear case, and there by at most a factor 2 for a y inside the ball), which is why this grouping keeps norm and vector consistent. Measured on 2.7M adversarial rows per dtype — random pairs, x ⊕ (−x), coincident points, and a near-boundary antipodal grid spanning ε ∈ {1e-2 … the eps**0.75 ceiling margin} × ‖n‖/(εR) ∈ {0.01 … 10} × three directions of n, at c ∈ {0.3, 1, 2.5} (logs/2026-09-03_b2_mobius_norm/probe_mobius_norm.py): worst overshoot of max_norm is 10 ulps and no row exceeds max_norm·(1 + 16·eps), leaving the result inside the true radius 1/√c with 54x (float32) / 26000x (float64) of the eps**0.75 margin to spare. The three-dot form overshoots by up to 3.5e5 ulps and the (A+B)/2, (A−B)/2 form — cancellation-free as a formula, but a norm of the exact A·x + B·y — by up to 6.5e9; both put 9% of the antipodal rows more than 1% outside the ball. Zero NaN or inf in values or in grad(Σ dist) / grad(Σ logmap) on every family. Values are not bit-identical to the previous release. On well-conditioned inputs rows move by at most 5.7e-7 (float32) / 1.5e-15 (float64) of the ball radius, i.e. 2–3 ulps, and the clamp decision differs on ≤ 1.3e-4 of rows. Where the two forms disagree materially the new one is more accurate: against a float64 reference its error is 0.48–0.60x the old form's at every ε in the antipodal grid; x ⊕ (−x) is now exactly zero, where the old form left a residue of up to 1.3e-3 of the ball radius in float32; and at the float64 ceiling margin (ε ≈ 4e-12) the error is ~1e-7 of the radius against the old form's 1.0, i.e. the old numerator there was pure rounding noise. On the near-boundary antipodal grid the clamp decisions differ on 20–70% of rows, which is expected and not a regression: that is the regime in which the old implementation's own decision was made on a numerator with no significant bits left. proj and proj_batch are untouched, and every other caller of them is unaffected.
  • Float32 tanh and atanh in hyperbolix.utils.math_utils are closer to correctly rounded (exact bit-pattern ulps vs a float64 reference, 20k inputs per range, max ulp before → after). atanh below 1/8 uses the odd Maclaurin series through x⁹ (float32 only; float64 keeps the single-log1p form bit-for-bit): GPU 3 → 1, CPU 2 → 1. tanh for |x| ≥ 1/8 (float32; 1/2 in float64) uses t/(t + 2) with t = expm1(2|x|): GPU [0.125, 0.9] 4 → 3 and [0.9, 7] 5 → 2; CPU [0.9, 7] 4 → 1; float64 CPU [0.9, 7] 5 → 1. No range regresses on either backend; both wrappers stay bitwise odd with derivative exactly 1 at 0, seams are continuous to ≤ 2 ulp, and the float32 derivative's error vs 1 − tanh² drops from 1.2e-6 to 2.4e-7. Effect on the float32 Poincaré round trip logmap_0(expmap_0(v)) (dim 32, c = 1, median relative error): radius 4: 1.69e-5 → 5.4e-6 (GPU) and 5.7e-6 (CPU); radius 1e-3 on CPU 2.4e-7 → 1.2e-7; GPU at radius ≤ 1 unchanged (already at the noise floor). Below 1/8 tanh uses neither kernel: it evaluates the odd Maclaurin series x − x³/3 + 2x⁵/15 − 17x⁷/315 (Horner in x² on |x|, float32 only — float64 keeps jnp.tanh below its own 1/2 seam bit-for-bit). On [1e-4, 0.125], 20k log-uniform inputs at both signs, max / mean ulp: GPU 4 / 0.87 → 1 / 0.16, CPU 4 / 0.96 → 1 / 0.16. The series' first dropped term is 62x⁹/2835, i.e. 1.6e-10 absolute at x = 1/8 against a float32 eps of 1.2e-7, so on that range it is exact to rounding; the expm1 form cannot be used there (6 ulp on CPU). Nothing above the seam moves — [0.125, 0.9] and [0.9, 7] are bit-for-bit identical on both backends — and the float32 tanh seam gap shrinks from 0/1/0 ulp (CPU) and 2/1/2 (GPU) to 1/1/1 and 1/0/1. Poincaré round trip at radius 1e-3 (dim 32, c = 1, median relative error) drops a second time on CPU, 1.2e-7 → exactly 0, matching the GPU; radius 0.1: 1.0e-7 → 5.2e-8; radius ≥ 1 unchanged.
  • Poincare.scalar_mul and Poincare.expmap route their tanh through hyperbolix.utils.math_utils.tanh, the accurate wrapper expmap_0 already used. The two were the last raw jnp.tanh calls in the module. The wrapper is more accurate in float32 (odd Maclaurin series below |x| = 1/8, expm1 form above it, vs XLA's ~4 ulp rational approximation) and its ±(1 - 10·eps) output clip pairs with atanh's own domain guard, so an atanh/tanh round trip cannot reach the pole. Values are not bit-identical in float32. Measured over 1152 rows per op (dim 16, radii log-spaced across the whole in-ball range, c in {0.3, 1, 2.5}, r in [-2.5, 2.5]), max relative movement: scalar_mul 3.2e-7 and expmap 2.6e-7 in float32 (2-3 ulps; ~36% of entries move), and 4.2e-16 / 5.9e-16 in float64 — where movement occurs only above the wrapper's own float64 seam at |x| = 1/2; below it the wrapper falls back to XLA's tanh and every entry is bit-identical (0 of 3072 bit patterns changed) (logs/2026-09-03_poincare_origin_numerics/probe_item3_tanh_wrapper_and_proj_batch.py)
  • _gyrovector_core._proj_batch takes its boundary bound from the _max_norm helper instead of re-inlining the expression. _max_norm reads only the array's dtype, so the bound is a scalar either way and the clamp is bit-identical: 0 of 3072 bit patterns move in either dtype over a (64, 16) batch at c in {0.3, 1, 2.5} with rows inside, exactly at, and up to 1e8 past the boundary plus an exact-zero row, and _proj_batch(X, c) still equals row-wise _proj bit for bit
  • Developer tooling: undefined names are checked again. [tool.pyright] listed "hyperbolix" in both include and exclude, so pyright analysed 0 of 57 modules and always reported "0 errors"; the tree is analysed again under typeCheckingMode = "off" with reportUndefinedVariable (plus the existing unused/duplicate-import rules) enabled explicitly. Ruff's F821 is now on for tests/ and ignored only under hyperbolix/**, where jaxtyping shape strings produce 572 false positives and no true ones. New tests/test_imports.py imports every module in the package, one test per module.
  • Developer tooling: pyright runs in typeCheckingMode = "basic" and the package is clean — 0 errors, with no rule disabled and no # type: ignore added to get there. Basic mode reported 110 errors when it was first switched on (reportOperatorIssue 49, reportArgumentType 46, reportReturnType 5, 10 others). 93 of them were one thing: the Curvature union ScalarCurvature | Sequence[ScalarCurvature] was the annotation on every manifold's c, so jnp.sqrt(c), c * x and 1/c were all checked against a sequence that supports none of them. Every single manifold and the Manifold protocol itself now declare c: ScalarCurvature — 286 annotations across 19 modules — and only ProductManifold keeps the union, which still satisfies the protocol because an implementation's parameter may be wider than the one it implements. ScalarCurvature is exported from hyperbolix.manifolds alongside Curvature, and no runtime behaviour changes: this is the annotation catching up with what the code always required. Three real defects came out with it: the Manifold protocol was missing the trailing version_idx on dist/dist_0 and atol on is_in_manifold/is_in_tangent_space that its own docstring promised (so compute_pairwise_distances, which forwards version_idx, did not type-check against it); hyperbolix.utils.__all__ listed MATMUL_PRECISION, which moved to hyperbolix.utils.precision and was never re-imported, so from hyperbolix.utils import * raised AttributeError; and hyp_pad2d(pad_mode="origin") documents c as required but never checked it, failing with an opaque TypeError: unsupported operand type(s) for / — it now raises a ValueError naming the argument. scalar_mul's r is widened from float to float | Float[Array, ""], which is what GyroBatchNorm/GyroRMSNorm already pass and what ProperVelocity._scalar_mul already declared. The remaining handful were values whose type @jax.jit erases: jax annotates the decorator as returning jax.stages.Wrapped, whose __call__ returns Any, so safe_norm(x) and every other jitted helper in hyperbolix.utils.math_utils handed its callers an untyped value, which pyright then widened into Array | tuple[Array, ...] at the next jnp.where and reported against whatever declared type that union eventually reached. The 13 decorators in that module now go through a one-line _jit wrapper typed Callable[P, R] -> Callable[P, R], so the declared return type survives; it returns exactly the object jax.jit returns, so tracing, the compilation cache, __name__, __doc__ and static_argnames are all unchanged.
  • API reference now covers the full hyperbolix.utils export surface and hyperbolix.utils.precision, with several stale version/count claims and numeric docstring constants corrected.

Notes

  • Four tests and one test oracle asserted properties no GPU backend promises, and now assert what the backend can actually deliver. None of the tolerances that guard a library defect moved. (1) XLA:GPU's float32 divide is only faithfully rounded — x / x != 1.0 for 16.25 % of 200 000 random float32 values, error up to 2 ulp (float64 is exact; CPU is exact in both). That 1-ulp perturbation of a unit direction is amplified by √(r_x·r_y) ≈ e^((a+b)/2)/(2√c) in the pairwise distance's angular term, so test_hyperboloid_dist_stable_exact_along_radial_geodesic drops its (29, 30) radius pair from the float32 leg (float64 keeps its own (19, 20) and (55, 60) pairs), and test_hyperboloid_dist_on_a_shared_ray_is_the_radius_difference caps its float32 legs at a ≤ 5. This is not a GPU-only limit: float32 cannot resolve collinearity in the ambient chart past radius ≈16 on any backend — with a generic (rather than all-components-equal) direction the same construction fails on CPU from radius 20 — so _hyperboloid_basis's docstring claim of a radius-80 threshold is corrected to the measured ≈16. (2) test_poincare_proj_batch_matches_the_vmapped_single_point_proj asserted rtol=0, atol=0 between reductions over (8, 10) and (2, 8, 10); XLA:GPU picks its reduce kernel per shape by autotuning, so the two disagreed by 1–2 ulp in 1 of 3 process launches. Now 2 ulp of the dtype. (3) test_activation_applies_euclidean_fn_to_spatial asserted bit equality between a jitted and an eager transcendental; float64 tanh differs by 1 ulp on one element in ten on GPU. Now 1 ulp — the two value assertions in that test stay strict. (4) _naive_lorentz_midpoint, the baseline test_lorentz_midpoint_small_norm_matches_naive compares the library against, carries the same MATMUL_PRECISION as the library: with the library fixed and the baseline still on TF32, that comparison measured TF32 rather than the difference between the two algebraic forms
  • Near-origin float32 accuracy depends on the backend, and the gap is XLA's transcendental kernels, not the formulas. Exact bit-pattern ulp error against a float64 reference (20k inputs in [1e-4, 0.9], max / mean): tanh 4 / 0.85 (XLA GPU), 4 / 0.90 (XLA CPU), 1 / 0.01 (torch CPU), 2 / 0.17 (torch CUDA); atanh 3 / 0.45 (XLA GPU), 2 / 0.25 (XLA CPU), 1 / 0.00 (torch CPU), 3 / 0.45 (torch CUDA, bit-identical to XLA GPU); arcsinh 2 on all four; expm1 1 (GPU) / 5 (CPU). Consequence for float32 Poincaré logmap_0(expmap_0(v)) at radius 1e-3 (dim 32, median relative error): 2.4e-7 on the CPU backend before the tanh/atanh change above (1.2e-7 with the expm1 seam, exactly 0 once the below-1/8 series landed), exactly 0 on GPU throughout. A torch-based library reaches ~1.5e-8 on CPU because torch's CPU tanh/atanh are correctly rounded; on CUDA it has no such edge. The closed forms are identical and nothing in hyperbolix is wrong here, but quote the backend alongside any near-origin float32 accuracy number
  • Poincaré round-trip ceiling. proj holds points inside 1/√c by a margin of eps**0.75 (_gyrovector_core._get_max_norm_eps), which caps the largest representable tangent norm at ‖v‖ = atanh(1 − eps**0.75)/√c — a geodesic radius of 2·atanh(1 − eps**0.75)/√c ≈ 12.65/√c (float32) / 27.7/√c (float64) at c = 1. Past it expmap_0 saturates and logmap_0(expmap_0(v)) returns the ceiling instead of v. Measured ceilings (median returned ‖v‖, in units of 1/√c; double for the geodesic radius): hyperbolix 6.32 (float32) / 13.86 (float64); geoopt and hypLL both 3.11 / 6.10, from fixed margins of 4e-3 and 1e-5; the unguarded closed form 8.66 / 18.72. The wider margin is deliberate, capping the conformal factor at ~3e5 (float32) / ~1e12 (float64)
  • The float64 CPU log1p hole that 1.1.1's atanh rewrite worked around is fixed upstream (openxla/xla#46765, shipped in jax ≥ 0.11.1; tracked as jax-ml/jax#39707). The rewrite stays: it costs nothing and still protects jax ≤ 0.11.0, which is what the lockfile pins (0.9.1)
  • Removed the tautological tests/test_manifolds.py::test_hyperboloid_scalar_mul_eq2. It asserted t ⊙ x == expmap_0(t · logmap_0(x)), which became a comparison of Hyperboloid.scalar_mul against its own implementation once that was rewritten to _expmap_0(r * _logmap_0(x, c), c) — the paper's Eq. 2 verbatim. The property it was meant to pin is covered non-circularly by test_hyperboloid_scalar_mul_matches_the_closed_form_near_the_origin, which checks t ⊙ x against the analytic [cosh(√c·t·d₀)/√c, sinh(√c·t·d₀)/√c · x̂_s] down to spatial radius 1e-8

1.1.2 - 2026-08-25

Fixed

  • Hyperboloid dist/logmap/sqdist/tangent_norm lost all precision for two points that were each far from the origin and close together — now cancellation-free at any representable radius. Every one of these routed through the Minkowski inner product ⟨x,y⟩_L = -x₀y₀ + ⟨x_s,y_s⟩, a subtraction of two positive terms each roughly e^(√c·(d₀(x)+d₀(y))) in size; the number of significant digits lost is set by the Gromov-product-like quantity √c·(d₀(x)+d₀(y)-d(x,y)), and past ln(1/eps) — 15.9 (float32) / 36.0 (float64) — every digit of the result is cancellation noise, not signal. Measured before this fix: float32 dist returned 0.0015 for a true distance of 1.0 between two points at radius 10; logmap returned NaN from radius ~10 (float32) / ~20 (float64); tangent_norm returned ~0 (a 100% error, no warning) on exactly-unit tangent vectors past radius 8 (float32) / 20 (float64). Deep metric-learning embeddings routinely sit at radius 30–60, so this was not an edge case. dist, sqdist, and logmap are rewritten to share a _polar_frame decomposition built from the hyperbolic law of cosines in half-angle (haversine) form — a sum of non-negative terms with nothing to cancel; tangent_norm eliminates v₀ through the tangency condition, trading one power of x₀ out of the error (now exact to radius ~15 float32 / ~25 float64, up from ~8/~20). Values inside the previously-trusted regime change within the old float32/float64 noise level; values past the threshold change from silent garbage to correct. VERSION_LEGACY (2) and VERSION_LEGACY_SMOOTHENED (3) reproduce the pre-fix acosh-based arms bit-for-bit, for reproducing results computed before this fix — VERSION_DEFAULT (0) and VERSION_SMOOTHENED (1) now point at the stable forms. expmap (two-point), ptransp, tangent_proj, tangent_inner, egrad2rgrad, and is_in_manifold still route through the Minkowski inner product and remain unsafe past the same threshold; origin-chart operations (dist_0, logmap_0, expmap_0) read the radius straight off the ambient time coordinate and were never affected. New hyperbolix.utils.safe_norm/safe_hypot/safe_normalize — overflow- and underflow-free norm primitives the new decomposition depends on — are exported alongside the fix. Supersedes the VERSION_SMOOTHENED floor value (≈ 0.166/√c) quoted in the smooth_clamp entry below (1.1.0): that floor belonged to the old acosh-based arm now at VERSION_LEGACY_SMOOTHENED. The new VERSION_SMOOTHENED's floor is 2·arcsinh(10·eps)/√c ≈ 2.4e-6/√c (float32) — see the numerical-stability guide for the full version breakdown
  • lorentz_residual and lorentz_midpoint lost the Minkowski square to catastrophic cancellation at large spatial radius. Both build a raw ambient vector h and normalize it back onto the sheet by sqrt(|<h,h>_L|), and both computed <h,h>_L = -h_0^2 + ||h_s||^2 naively: for on-sheet inputs h_0 ≈ ||h_s||, so each square is ~||s||^2 (spatial radius of the inputs) while their difference is only O(1/c) — float32 relative error therefore grows as eps32 * c * ||s||^2 with eps32 ≈ 1.19e-7. Measured against float64 at c=0.1, x ≈ y, d=16 (forward / gradient relative error): 9.9e-5 / 3.0e-4 at ||s||=1e2, 6.1e-3 / 1.8e-2 at 1e3, 6.4e3 / 1.0 at 1e4 — past ||s|| ~ 1e4 the computed square flips sign, the abs() in the normalizer hides the flip, and the maximum(., 1e-7) floor silently inflates the output by 2/sqrt(1e-7) ≈ 6325× (measured 6324.6 at c=0.1, ||s||=2e4, x == y). Never a NaN, never a warning, and dormant at norm-capped activations (||s|| ≲ 20); the gradient path degrades ~3× earlier in ||s|| than the forward, from a second cancellation in the normalizer's Jacobian. Both functions now evaluate <h,h>_L through exact identities — valid for any weights given inputs on the sheet (<x,x>_L = -1/c), verified in exact rational arithmetic: for the residual h = x + w·y, <h,h>_L = -(1+w)^2/c - w·<x-y, x-y>_L; for the midpoint with reference p the vertex-nearest input, delta_m = x_m - p, W = Σ_m w_m and Delta = Σ_m w_m·delta_m, <h,h>_L = -W^2/c - W·Σ_m w_m·<delta_m, delta_m>_L + <Delta, Delta>_L. Every rounded term is now O(||x-y||^2) instead of O(||s||^2): new float32 error at ||s||=1e4 is 2.1e-5 forward / 6.0e-4 gradient (residual) and 1.6e-5 / 4.3e-4 (midpoint, M=8 softmax weights), and no regime where the old form was still usable measured worse (swept c ∈ {0.01, 0.1, 1}, ||s|| from 1 to 1e5, near/far/same-direction/identical points; at ||s|| ≤ 20 old and new agree to ~2e-7 relative, not bit-identical — different rounding order). The one float32 limit that remains is the difference x - y itself: points that share a direction at ||s|| ≳ 1e4 lose it to rounding before either form sees it, and neither form is trustworthy there — that regime needs float64. For w_y >= 0 resp. non-negative weights the identities give c·|<h,h>_L| >= (1+w)^2 resp. >= W^2, so the abs() and the eps floor are now provably inactive (both kept as insurance). Affected layers: LorentzResidual, HypformerPositionalEncoding, HyperbolicFullAttention (attention aggregation and head averaging), HyperboloidGyroRMSNorm, hyperboloid frechet_mean, and any direct caller of the two functions. The LResNet reference implementation (He et al. 2025) has the same defect. Both outputs additionally have their time coordinate reconstructed from the spatial part via spatial_to_hyperboloid (x_0 = sqrt(||x_s||^2 + 1/c), the same convention as hrc/htc), so they are on-sheet by construction — as the old self-normalizing h/sqrt(-c<h,h>_L) was — even for inputs float storage cannot keep on the sheet (it needs eps·x_0^2 << 1/c, violated past ||s|| ~ 3e3 in float32 / ~1e8 in float64, e.g. a Poincaré ball-boundary point lifted to x_0 ≈ 5.5e11): the identity assumes exactly on-sheet inputs, so for those it returned a point off the sheet by 4.8e-3 and hyperboloid frechet_mean's Karcher loop diverged to NaN from it; the midpoint's reference p is now the vertex-nearest input rather than points_0, bounding every ||delta_m|| <= 2||x_m||. No API change; cost is O(1) extra for the residual and one extra einsum for the midpoint

1.1.1 - 2026-08-04

Added

  • hyperbolix.utils.capped_exp — exp with the argument capped at 0.99*log(finfo.max), for exp of unconstrained trainable log-scale parameters. A runaway parameter otherwise overflows to inf, which turns into NaN downstream (inf - inf in the hyperboloid time-coordinate algebra) and poisons the whole parameter tree within one optimizer step; capped_exp saturates finite instead, with a zero (not NaN) gradient past the cap. Below the cap it is a bitwise value- and gradient-identity to jnp.exp. Same idiom LearnableCurvature's "log" parameterization already used internally, now shared. Applied to the three call sites that had a bare jnp.exp on such a parameter: the Busemann FC layer's alpha = exp(log_scale), and both FHCNN/FHNN forward passes' exp(scale_val) * sigmoid(...) time-coordinate scaling

Fixed

  • atanh/sinh/cosh float64 accuracy: XLA's CPU lowerings have large ulp errors that hyperbolix's wrappers previously inherited. jnp.atanh is lowered to 0.5*(log1p(x) - log1p(-x)), and XLA's CPU float64 log1p is up to ~129 ulps off for arguments in [-0.53, -0.28] (NumPy's is <1 ulp there) — atanh inherited ~129 ulp error for x in ~[0.28, 0.53], peaking at sqrt(2)-1. jnp.sinh/jnp.cosh are separately inaccurate for large arguments: ~17 ulps for |x| in [16, 512] and ~496 ulps for [512, 710] (float64; the jump sits exactly at the power-of-two boundary 512), and ~24.5 ulps in float32 across the full range. Float32 atanh was unaffected. hyperbolix.utils.math_utils.atanh is rewritten as the odd-symmetrized single-log1p identity atanh(x) = sign(x)*0.5*log1p(2|x|/(1-|x|)) (computed on |x| so the log1p argument never enters the bad window, with the sign restored via where rather than sign(x)*... — a sign-multiplied form has zero gradient at x=0, not the analytic 1). sinh is rewritten as 0.5*(expm1(x) - expm1(-x)) (cancellation-free everywhere: the two expm1 terms have opposite signs) and cosh as 0.5*(exp(x) + exp(-x)) with a custom_jvp routing its gradient to the accurate sinh form (a bare exp-form cosh's autodiff gradient is the naive cancelling sinh, inaccurate near 0). All three rewrites measure at a few ulps across their full domain (vs. the errors above) and are the same speed or faster than the builtins. Raw jnp.sinh/jnp.cosh/jnp.acosh call sites that bypassed the wrappers (the FGG spatial lift, the Busemann FC output map, the wrapped-normal log-density, and the uniform-Poincaré volume/samplers) now route through them, closing the same accuracy gap plus, in the acosh case, a singular-gradient exposure at an exact-1.0 domain boundary. No API changes; every downstream distance/logmap/MLR computation using these functions gets more accurate for free

1.1.0 - 2026-08-01

A correctness release. A full audit of the test suite replaced shape-only checks and self-comparisons with independently transcribed NumPy/SciPy oracles, and every library defect it exposed is fixed below. No new capability beyond hyp_flatten2d; several corrections change behavior or call signatures, each marked Breaking and each with the migration in its entry.

Added

  • hyp_flatten2d (hyperbolix.nn_layers) — radius-preserving flatten of an NHWC hyperboloid feature map into one manifold point per image via Hyperboloid.log_radius_concat: (B, H, W, A) → (B, H·W·(A−1)+1). The naive alternative (reshape + hcat) inflates the expected spatial radius by ≈ √(H·W) (a 4×4 map: 4×); LogCat's digamma rescale hands the classifier head the per-pixel radius unchanged. This is the flatten step for HypConv2DHyperboloidILNN stacks feeding HypRegressionHyperboloid/FGGLorentzMLR
  • Poincare.proj_batch — batched sibling of Hyperboloid.proj_batch (arbitrary leading axes, bit-identical to vmap(proj)); HoroPCA and CO-SNE now use it instead of hand-rolled vmaps
  • hyperbolix.manifolds._base.default_atol(dtype) = sqrt(finfo(dtype).eps) — the library-wide constraint-tolerance convention (float32 3.45e-4, float64 1.49e-8) that is_in_manifold / is_in_tangent_space resolve None through on every manifold
  • HypformerPositionalEncoding accepts param_dtype and forwards it to its internal HTCLinear — float64 models were previously impossible (weights pinned to float32)
  • New exports: hcat_ambient_dim and busemann_fc_poincare_output from hyperbolix.nn_layers (both already served as test oracles and answer user-facing sizing questions); lift_ideals and orthonormalize_rows from hyperbolix.decomposition

Fixed

  • Hyperboloid.log_radius_concat scaled the wrong way, amplifying the spatial radius instead of preserving it. The two digamma arguments were swapped: the shipped exp(½·(ψ(N·d/2) − ψ(d/2))) is ≈ √N, so concatenating N blocks inflated the expected log spatial radius by ≈ log N — worse than the plain hcat the rescale exists to correct. The correct factor is the shrink exp(½·(ψ(d/2) − ψ(N·d/2))) ≈ 1/√N: for Gaussian spatial parts ‖v‖² ~ χ²_k gives E[log‖v‖] = ½(ψ(k/2) + log 2), so restoring the per-block value after widening d → N·d requires dividing by the ratio of the two chi radii. Nothing raised, because the mis-scaled output is still a valid manifold point (Lorentz residual ~1e-13) — only its radius was wrong. The Shi et al. 2026 reference implementation has the same sign error. Sole affected layer: HypConv2DHyperboloidILNN, where it inflated the spatial radius ≈9.4× per 3×3 conv, compounding with depth (hcat-based layers — FGG, FHNN — never used this path). Behavior change — see the coupled default-init change below
  • hyperbolix.optim.has_manifold_params always returned False. nnx.Variable is itself a registered pytree node whose single child is the raw array, so the unguarded jax.tree_util.tree_leaves call unwrapped every ManifoldParam into an ArrayImpl before the isinstance check ran — the function reported "no manifold parameters" for a bare ManifoldParam, a dict of parameters, nnx.state(model, nnx.Param) (its own documented usage) and a model alike. The traversal now stops at nnx.Variable leaves. The Riemannian optimizers were not affected: _riemannian_base already flattened with that guard everywhere it inspects Variable types, so only callers using has_manifold_params as a guard saw the false negative
  • Wrapped-normal log_prob crashed on sample()'s own output whenever the mean was batched and sample_shape non-empty (both distributions.wrapped_normal_poincare and wrapped_normal_hyperboloid). Step 2 of the density computation vmapped the sample axis S and the mean's batch axis B together, so any call with mu.ndim > 1 plus a non-empty sample_shape raised a ValueError/TypeError on shapes the sampler itself produces; step 1 was also mis-batched (2-D mu pushed through the single-point logmap, relying on broadcasting). Both steps now share a _vmap_sample_and_batch helper that vmaps batch axes innermost and sample axes outermost, matching the (*S, *B, dim) layout of the sampling side; previously-working shape combinations are bit-for-bit unchanged. log_prob is now pinned from four independent directions (2-D polar quadrature integrating to 1, change-of-variables vs jacfwd of the sampling map, the flat c → 0 limit vs scipy MVN, and the Poincaré↔hyperboloid isometry cross-check with no Jacobian — the density is w.r.t. Riemannian volume)
  • Poincaré wrapped-normal log_prob gradient at z == mu was NaN — in float64 too, not just float32. The radial norm entered the log-det Jacobian without a floor, so the gradient of the norm at the mean produced NaN; it is now floored at 1e-15 exactly like the hyperboloid sibling (the zero gradient maximum contributes on the clamped side is correct — the log-det is stationary at r = 0). Separately, the shared _log_det_jacobian_from_r helper used a single jnp.where across its Taylor gate, so reverse-mode AD propagated NaN from the unselected log(sinh(x)) − log(x) branch at exactly r = 0; it now uses the double-where idiom. That second defect is unreachable from either log_prob once r is floored, but is fixed for direct callers of the helper
  • smooth_clamp could exceed its own bounds on narrow windows. All three clamps (smooth_clamp, smooth_clamp_min, smooth_clamp_max) are re-derived as gate-free closed forms: the two-sided clamp is the difference form min + softplus_β(x−min) − softplus_β(x−max), provably inside (min, max) for every window and β — composing the two one-sided clamps (the old construction) overshoots a narrow window by up to ln(1+e^(−βw))/β, which for βw ≲ 1 is the size of the window itself; a test now pins that the composition fails so it can't be "simplified" back. Evaluation uses the hinge+remainder split clip(x) + tail − tail (tails ≤ ln 2/β), avoiding float32 catastrophic cancellation, and the gradient is exactly sigmoid(β(x−min)) − sigmoid(β(x−max)) with correct one-sided values at the hinge. Downstream consequence: the VERSION_SMOOTHENED hyperboloid distance is now monotone with floor acosh(1+ln2/β)/√c ≈ 0.166/√c and agrees with VERSION_DEFAULT beyond ≈ 0.8/√c (it was previously non-monotone near coincident points)
  • Euclidean.is_in_manifold returned constant True, accepting NaN/Inf — it now checks finiteness. The same defect existed on is_in_tangent_space for Euclidean, Poincare, and Stereographic (the tangent space of an open subset of R^n is R^n — finiteness is the only constraint); all three fixed
  • Wrapped-normal log-det-Jacobian Taylor gate is now dtype-aware. The log(sinh(x)/x) series switch used a float32-tuned threshold in float64 too; it now sits at (10³·eps)^(1/6) per dtype — the crossover where the 2-term series' truncation error (~x⁶/2835) meets the direct branch's cancellation error (~eps·|log x|) — with the series extended to two terms. Validated against a high-precision oracle on both sides of both gates
  • LearnableCurvature's straight-through clamp amplified gradients in the clamped region. With parameterization="log" at the exponent cap, the pass-through handed the raw parameter a gradient scaled by dc/draw = c — up to e^15 at the cap — so one step could catapult the parameter across its whole range. The pass-through now divides the clamped-region gradient by max(dc/draw, 1) (implemented as a stop-gradient carrier swap, so no reciprocal is formed that would flush to zero in float32 at the cap). Interior gradients are bit-identical, the forward value is unchanged, and gradients below the lower clamp are never amplified either
  • ProperVelocity.dist/dist_0 returned NaN gradients at the origin (grad dist(0,0), grad dist_0(0)): bare jnp.linalg.norm has a 0/0 VJP at the zero vector. Both now use the module's _safe_norm, whose gradient at 0 is exactly 0 — the correct subgradient. Value shifts by at most 1e-15, below float64 resolution of any distance
  • uniform_poincare hardcoded float64 and broke its own shape contract. log_prob now returns x.dtype (was always float64) and honours the documented (..., n) → (...) signature at any rank (ndim > 2 raised a dot_general TypeError); sample infers its dtype from center, then manifold_module, then JAX's default float; volume takes a dtype argument. The Gauss-Legendre tables are plain Python tuples now, so import hyperbolix no longer emits three UserWarnings (and silently truncated float32 tables) when jax_enable_x64 is off
  • The two hyperbolix.utils.helpers docstring examples raised AttributeError (they called proj on the module, not an instance); both rewritten and verified via doctest

Changed

  • HypConv2DHyperboloidILNN default kernel init is now fan-out and norm-preserving. kernel_init_std accepts None (the new default), which resolves to sqrt(1 / out_spatial). Near the origin the PLFC chain linearizes to y_spatial ≈ W @ u_spatial (both asinh and sinh are identity to first order, and the bias starts at 0), so a Gaussian W of shape (O, I) has RMS gain std·sqrt(O); the corrected LogCat hands over the per-pixel spatial radius unchanged, leaving std = 1/sqrt(O) as the unit-gain choice. This is coupled to the LogCat fix above and is not optional: the previous fixed 0.02 was calibrated against the pre-fix ~√N amplification (the two errors cancelled at width ~64, 0.02·sqrt(64)·9 ≈ 1.4 for a 3×3 kernel), and under the corrected shrink it contracts the mean spatial norm by 7–15× per layer — a depth-3 stack sits on the manifold origin at init, with no clamp or warning to show for it. Probe-measured per-layer spatial-norm ratios at depth 3 (c=0.1, 3×3, 8×8 input, float64): 0.82–0.95 with the new default versus 0.05–0.15 with 0.02. kernel_init_std=0.02 still reproduces the Shi et al. 2026 draw bit-for-bit, but it now restores a regime that implicitly assumed the pre-fix LogCat. HypLinearHyperboloidPLFC is unchanged — it has no LogCat
  • Breaking: LorentzConv2D requires manifold_module as its first positional argument, consistent with every other hyperboloid convolution. It is used as a family-identity check (a Poincaré manifold now fails validation instead of being silently misread as [time, space]); no manifold method is called in the forward pass. Update: LorentzConv2D(in_ch, ...) → LorentzConv2D(Hyperboloid(), in_ch, ...)
  • Breaking: Riemannian optimizer learning-rate schedules are resolved at the pre-increment step count, matching optax's scale_by_schedule: the k-th update() reads schedule(k−1), so the first update uses schedule(0). Previously the schedule ran one step ahead of every optax reference (a warmup's step-0 rate was never used). Constant learning rates are unaffected; Adam-style bias correction deliberately keeps the post-increment count, which is also optax's convention — the two timings are different counters by design
  • Breaking: HypRegressionPoincare kernel init changed from normal(0, 1) to std = (2·in_dim·out_dim)^{-0.5}, matching HypRegressionPoincarePP and HypRegressionHyperboloid (van Spengler et al. 2023). The unscaled init gave row norms ≈ sqrt(in_dim) that reappear as the outer ‖a‖ multiplier in the MLR score, scaling the logits linearly: at 128→64 the logit std at init was 74, now 0.58. There is no flag to restore the old init
  • Breaking: one atol convention across all manifolds. is_in_manifold / is_in_tangent_space take atol: float | None = None, resolved via default_atol (see Added); an explicit value is never floored, clamped, or dropped. Previously Hyperboloid.is_in_manifold silently floored atol at 1e-4 (no caller could tighten it), Poincare ignored it entirely, and Hyperboloid.is_in_tangent_space never forwarded the one it accepted. Ball membership now tests the dimensionless residual c‖x‖² − 1, so one tolerance means the same at every curvature. Float64 hyperboloid membership is much stricter: genuinely on-sheet points past hyperbolic distance ~11 need an explicit atol
  • Breaking (widening): Euclidean, Stereographic, and ProductManifold dist/dist_0 accept a trailing version_idx (accept-and-ignore, per the ProperVelocity precedent), so compute_pairwise_distances and get_delta now work with all six manifolds instead of raising TypeError on three. ProductManifold cannot forward it to heterogeneous factors — use component_dist for per-factor control. The helpers' dead legacy module-API (_dist) fallback is removed
  • Breaking (trivial): import hyperbolix exposes all six subpackages (decomposition, distributions, manifolds, nn_layers, optim, utils) in __all__; hyperbolix.distributions previously raised AttributeError from a fresh interpreter until another module imported it. The lone root layer re-export hyperbolix.PoincareBatchNorm2D is removed with no alias — import it from hyperbolix.nn_layers
  • Breaking: internal plumbing marked private — busemann_core.init_weight_norm_params → _init_weight_norm_params, busemann_core.busemann_score → _busemann_score, gyro_normalization.GyroBatchNormBase → _GyroBatchNormBase, GyroRMSNormBase → _GyroRMSNormBase
  • Internal consolidation: the 1e-15 gradient-safety floor has one canonical home, hyperbolix.utils.math_utils.MIN_NORM (the copies in _gyrovector_core, hyperboloid, proper_velocity, busemann_core, hyperboloid_linear, and the three distribution modules are gone; isometry_mappings.MIN_DENOM renamed away); PV's private _mobius_gyration copy is deleted in favour of the shared _gyrovector_core._gyration; _batched_transform is a thin proven-bit-identical wrapper over _vmap_sample_and_batch; hope()'s time reconstruction delegates to spatial_to_hyperboloid (proven bit-identical); frechet_variance is typed manifold-generic (Manifold, matching its Hyperboloid/PV callers); HypLinearPoincare/HypRegressionPoincare drop the never-called compute_mlr_pp from their required manifold methods

Documentation

  • Fixed four doc examples that raised on construction (HypRegressionHyperboloid, HyperbolicSoftmaxAttention, PoincareBatchNorm2D, HypConv2DHyperboloid), the riemannian_adam b1/b2 example, and the uniform_poincare example (nonexistent dim= argument, sample count passed as the dimension, wrong volume value) — all now execute
  • Rewrote the layer initialization-scale table to match actual defaults (split HypLinear*PP from the regression heads; added HypLinearHyperboloidPLFC and HypConv2DHyperboloidILNN rows); fixed ambient-vs-spatial channel-convention contradictions (documented the HTCLinear.out_features-is-spatial exception; HCat growth is internal — output width is always out_channels); corrected "manifold-valued weights" to "manifold-valued bias" for the legacy Ganea layers and repositioned mark_manifold_param as guidance for hand-rolled parameters (built-in layers self-tag)
  • Real Hypformer citation (Yang et al. 2025) in 7 docstrings; LorentzConv2D attribution unified on LResNet; superseded-by notes on LorentzConv2D, HypLinearPoincare, HypRegressionPoincare; param_dtype compute-precision wording corrected across the manifold-free layers; GyroBN shift/weight comment labels un-swapped; DEVELOPER_GUIDE.md pointers fixed
  • Deleted the three placeholder "coming soon" tutorial notebooks and the dead commented-out mkdocs-jupyter configuration; updated stale docs/index.md counts
  • As a one-off release audit, every python fence in docs/, README.md, and DEVELOPER_GUIDE.md was executed by hand to confirm it actually runs (this is not an automated CI check). Four more raised: smooth_clamp(min_val=, max_val=) (the arguments are min_value/max_value), get_delta(seed=42) (it takes a key), wrapped_normal_hyperboloid.sample(std=) (it takes sigma), and the is_in_manifold example, whose "hyperboloid point" was never on the sheet (-1.5² + 0.2² + 0.3² + 0.1² = -2.11, not -1) — it now builds the ambient point with spatial_to_hyperboloid. The HoroPCA example requested float64 without enabling x64, so it silently truncated to float32 with three UserWarnings
  • New sections for two breaking changes that previously appeared only in this changelog: the atol convention and default_atol (Numerical Stability) and learning-rate-schedule timing (Optimizers)
  • Corrected the layer and test counts in README.md and docs/index.md: 20+ → 40+ layers, and "3,500+ tests / 850+ test functions" → 3,551 items across 735 test functions

1.0.0 - 2026-07-24

First stable release. The public API is considered complete and stable, reaching functional parity with the broader hyperbolic deep learning ecosystem; future changes follow semantic versioning.

Added

  • CO-SNE (hyperbolix.decomposition.CoSNE) — dimensionality reduction and visualization for hyperbolic data (Guo et al. 2022), the hyperbolic analogue of t-SNE. A thin sklearn-style class (fit / fit_transform; non-parametric, so no out-of-sample transform, matching sklearn's TSNE) over a pure, JIT-friendly functional core (fit_cosne, conditional_probabilities, joint_probabilities, low_dim_probabilities, kl_divergence_loss, magnitude_loss). High-dimensional similarities are perplexity-calibrated on squared hyperbolic distances (paper Eq. 2); low-dimensional similarities use a heavy-tailed Student-t / Cauchy kernel on Poincaré-ball distances (paper Eq. 9 — both the author's-code plain-distance form, default, and the exact squared-distance form via exact_cauchy=True). On top of the t-SNE KL divergence it adds a magnitude loss H = (1/N)·Σᵢ(‖xᵢ‖² − ‖yᵢ‖²)² (paper Eq. 10) that preserves each point's distance-to-origin (the hierarchy depth). Optimization is two-stage projected gradient descent on the ball (early-exaggeration KL-only exploration, then KL + magnitude), with the KL gradient Riemannian-scaled by (1 − c‖y‖²)²/4 and the magnitude gradient Euclidean (paper §3.7). Curvature-general (a single c for both spaces, passed at fit time); Poincaré input (N, D) → (N, K) ball coordinates, Hyperboloid input (N, A) → (N, K+1). Uses exact autodiff gradients of the declared losses — a deliberate deviation from the reference's demonstrably buggy hand gradients — so the reference learning rates do not transfer; the learning_rate default (0.5) is calibrated on a synthetic-cluster recovery test and documented on the class. Double precision recommended for fitting
  • HoroPCA (hyperbolix.decomposition.HoroPCA) — hyperbolic dimensionality reduction via horospherical projections (Chami et al. 2021). A thin sklearn-style class (fit / transform / fit_transform) over a pure, independently usable and JIT-friendly functional core (fit_horopca, transform_horopca, horo_projection, horopca_loss). All computation runs on the hyperboloid (Poincaré input is mapped in via the exact isometry); K ideal points are jointly optimized with Adam + gradient clipping to maximize the pairwise-distance variance of the horospherically projected data, which preserves every Busemann coordinate. Poincaré input (N, D) → (N, K) ball coordinates; Hyperboloid input (N, A) → (N, K+1). K = 1 is supported via a closed form (the reference's Sherman–Morrison inverse is singular there). Exposes components_, mean_, boost_, losses_, and pairwise-variance-based explained_variance_ / total_variance_ / explained_variance_ratio_. Double precision recommended for fitting
  • hyperbolix.decomposition.frechet_mean — manifold-generic Karcher (Fréchet) mean via fixed-point iteration in a lax.while_loop (Lorentz-centroid init on the hyperboloid, projected-mean init on the Poincaré ball). The data-centering primitive HoroPCA builds on; configurable step_size / tol / max_iters
  • Hyperboloid.lorentz_boost(mu, c) — the exact Lorentz boost matrix B with B @ mu = origin (symmetric, proper, orthochronous), used to Fréchet-mean-center data before fitting. Closes a docs–code gap (the method was already advertised in the manifolds API reference)

0.11.1 - 2026-07-21

Changed

  • HTCLinear default init is now fan-in-aware and norm-preserving. init_bound accepts None (the new default), which resolves to sqrt(3 / in_features) — per-layer input-Jacobian gain ≈ 1, since htc applies no nonlinearity to the matmul output. The previous fixed U(-0.02, 0.02) was width-dependent contractive (gain 0.02/sqrt(3)·sqrt(in_features) ≈ 0.09 at fan-in 65): stacks of ≥ 2 layers collapsed input variation below the float32 noise floor, becoming a constant map with ≈0 gradients — training silently frozen from step 0 (observed in goal-conditioned RL: depth-2 HTC head, c=0.5, frozen through 3.1M steps; escape time monotone in the bound). The 0.02 was an in-house convention inherited from the FHNN/FHCNN family, not the Hypformer reference — the official Hypformer code initializes with Xavier-uniform gain sqrt(2) (bound = 2·sqrt(3/(in+out)), ~15× larger than 0.02 at fan-in 65), intended for its ReLU + LayerNorm regime; recover it by passing that bound explicitly. The attention layers (HyperbolicLinearAttention, HyperbolicSoftmaxAttention, HyperbolicFullAttention) and HypformerPositionalEncoding now default init_bound=None and inherit the fan-in-aware init for their HTC projections (matching the reference, whose Wq/Wk/Wv and positional encoding use the same Xavier init). FHNN/FHCNN/PLFC layers are unchanged — their 0.02 matches their references (verified against the official Chen 2021, Bdeir 2023, and Shi 2026 code). Behavior change — existing HTC models pick up the new init unless they pass init_bound=0.02 explicitly (bit-for-bit reproduction of the old init)

0.11.0 - 2026-07-14

Added

  • κ-Stereographic manifold (hyperbolix.manifolds.Stereographic) — a single constant-curvature manifold spanning hyperbolic, Euclidean, and spherical geometry via a signed curvature c (Bachmann et al. 2020): c > 0 is hyperbolic and reproduces Poincare(c) exactly (both now build on a shared internal _gyrovector_core module, so Möbius addition, gyration, conformal factor, and projection are bit-identical), c = 0 is the flat limit (carrying the conformal factor-2 metric — see the API reference), and c < 0 is the stereographic projection of the sphere. Note the sign flip vs the paper/geoopt (κ = -c), chosen so c matches every other hyperbolix manifold. Implements the full Manifold protocol plus conformal_factor, gyration, geodesic, geodesic_unit, and antipode, using curvature-generalized trig functions with a dtype-aware Taylor branch near c = 0 — gated on both |κ| and the series argument |κ|·‖x‖², so extreme chart radii (e.g. near-antipodal spherical points) always keep the exact closed form — and an exact closed-form antipode x/(c‖x‖²). Verified compatible with ProductManifold factors and the Riemannian optimizers (ManifoldParam + riemannian_adam/riemannian_sgd). The κ-GCN neural-network layers (mobius_matvec, weighted gyromidpoint, dist2plane, sproj) are not yet included. Double precision recommended when training a signed curvature that may cross zero, per the reference
  • hyperbolix.utils.tanh — clamped hyperbolic tangent whose output stays strictly inside (-1, 1): clips the input at the analytic saturation bound ±0.5·log(2/eps) and the output at ±(1 − 10·eps), because XLA's float32 tanh saturates to exactly 1.0 slightly before the input bound bites. Matches atanh's own domain guard, so atanh(tanh(x)) can never reach the pole. Used by the κ-stereographic maps in the hyperbolic regime
  • Signed identity reparameterization for LearnableCurvature (parameterization="identity", c = raw) — signed, crossing zero smoothly with gradient 1, for learning the sign of curvature with the Stereographic manifold; init_c may be zero or negative, and the default clamp resolves to a symmetric [-10.0, 10.0] (deliberately including 0) instead of the positive [0.1, 10.0] used by softplus/log. The log scheme's exponent is now capped at 0.99·log(finfo.max), so a drifting raw parameter yields a large finite curvature instead of inf; the cap is gradient-transparent under straight_through_clamp=True

0.10.2 - 2026-07-02

Changed

  • Legacy Ganea layers (HypLinearPoincare, HypRegressionPoincare) accept a curvature constructor argument (float or callable, default 1.0) for their manifold-valued bias tag instead of hardcoding 1.0. The Riemannian optimizer uses this tag for the bias update, so it must match the c passed at call time — previously any c ≠ 1.0 silently applied the wrong Riemannian correction to the bias

Fixed

  • Kernel-init corrections across hyperbolic layers: HypRegressionHyperboloid now uses the fan-scaled kernel init matching HypRegressionPoincarePP, and HypConv2DHyperboloid gains an opt-in reset_params="fan_in" for BatchNorm-free encoders
  • GyroBatchNormBase gains a min_var floor that prevents collapsed-variance saturation
  • FGGConv2D docstring stated the default weight init is "kaiming"; the actual default is "lorentz_kaiming"
  • PoincareBatchNorm2D now documents that the learned variance is an unconstrained scalar under a sqrt (NaN if driven negative) — kept as-is to match the van Spengler reference, with a workaround noted

0.10.1 - 2026-06-30

Added

  • GyroBatchNorm and GyroRMSNorm normalization layers for the Hyperboloid and Proper Velocity manifolds

0.10.0 - 2026-06-29

Added

  • LResNet lorentz_scale (He et al. 2025, Eq. 10) — Klein-geodesic output rescaling that slides a hyperboloid point along the geodesic ray from the origin to control output norm while staying on the manifold — and a constrained LorentzResidual module built on it
  • Busemann MLR and BFC layers (Chen et al. 2026)

Changed

  • FGG layer init defaults changed to norm-preserving. FGGLinear and FGGConv2D now default to reset_params="fan_out" (Gaussian, std=sqrt(1/out_spatial)) with init_bias=0.0 and a new gain=1.0 multiplier, so the output spatial norm tracks the input (‖z‖ ≈ gain·‖x_spatial‖) instead of growing as sqrt(out_channels) from step 0. This is a deliberate deviation from the Klis et al. 2026 classification reference (which normalizes magnitude away with BatchNorm/FGGMeanOnlyBatchNorm after each layer): it is motivated by unnormalized stacks — e.g. an RL backbone feeding a bounded Poincaré-ball projection, where the fan-in default saturated the projection. The new gain knob sets the effective column std to gain/sqrt(out_spatial); it is a no-op for reset_params="eye" and is renormalized away under use_weight_norm=True. Restore the previous reference-style init with reset_params="eye", init_bias=0.5 (FGGLinear) or reset_params="lorentz_kaiming", init_bias=0.5 (FGGConv2D). FGGLorentzMLR (a terminal Euclidean-logits head) is intentionally unchanged. Behavior change — existing FGG models pick up the new init unless they pass the old reset_params/init_bias explicitly

0.9.0 - 2026-06-23

Changed

  • Performance improvements across the hyperboloid layers
  • Unified the patch-extraction path into a shared hyperboloid_core._extract_patches helper (deduplication, no behavior change)

0.8.2 - 2026-06-12

Changed

  • Renamed HypConv2DHyperboloidPP → HypConv2DHyperboloidILNN — the Shi et al. 2026 Lorentz convolution (LogCat via log_radius_concat + PLFC), with origin padding (pad_mode="origin") and ILNN improvements

0.8.1 - 2026-06-12

Changed

  • Renamed HypLinearHyperboloidPP → HypLinearHyperboloidPLFC with PLFC (parametrized Lorentz fully-connected) improvements (Shi et al. 2026)

0.8.0 - 2026-06-11

Added

  • Poincaré vector quantization layers (hyperbolix.nn_layers):
    • HypVQEmbeddingPoincare: HVQ-VAE quantizer (Chen et al. 2025) — explicit on-ball codebook held as a non-parameter nnx.Variable buffer, geodesic nearest-neighbour selection, copy-gradient straight-through estimator, and a hyperbolic-EMA codebook update (GGBall, Bu et al. 2026, Eqs. 41-43) with optional dead-code revival via the ema_update method (called after optimizer.update; the optimizer never touches the codebook, only the commitment loss trains the encoder)
    • HypVQMLRPoincare: HyperVQ quantizer (Goswami et al. 2025) — implicit codebook = the rows of an internal HypRegressionPoincarePP, Gumbel-Softmax straight-through selection on the categorical weights (so plain optax.adam trains it), with a deterministic flag (toggled by model.eval() / model.train()) for a deterministic argmax MAP estimate at inference
    • PoincareVQOutput: shared pytree-friendly NamedTuple return type (quantized, indices, loss, perplexity, z); quantized is cast to float32 at the manifold→decoder boundary
    • poincare_weighted_midpoint: reusable Poincaré weighted gyromidpoint (GGBall Eq. 41), the Poincaré analog of lorentz_midpoint and a weighted generalization of poincare_midpoint
    • squared_commitment flag on HypVQEmbeddingPoincare (default False). The cited references genuinely disagree on the commitment penalty: HVQ-VAE uses the plain geodesic distance d(z, sg(q)), GGBall's L_HVQVAE uses d² (the Euclidean VQ-VAE convention). The flag selects between them without touching library code
  • Hyperboloid.log_radius_concat — log-radius-preserving concatenation of N Lorentz points (Shi et al. 2026, Sec. 4.3), the hyperboloid analog of Poincaré β-concatenation. Rescales each block's spatial part by exp(½·(ψ(N·d/2) − ψ(d/2))) (digamma ψ) so the expected log spatial radius stays invariant to the post-concat dimension, then recomputes the time coordinate to keep the result on the manifold. Reduces to hcat when N = 1; convolutional layers keep using the unscaled hcat by default
  • Isometry mappings now span all three models — Poincaré ↔ Hyperboloid, Poincaré ↔ Proper Velocity, and Hyperboloid ↔ Proper Velocity. New functions: pv_to_poincare, poincare_to_pv, pv_to_hyperboloid, hyperboloid_to_pv (in hyperbolix.manifolds.isometry_mappings). All six maps are exact, curvature-correct Riemannian isometries (PVNN Eq. 4; Chen et al. 2026). The direct pv_to_hyperboloid (PV coords are the hyperboloid's spatial part; time reconstructed from ⟨z,z⟩_L = -1/c) avoids the near-boundary blow-up of composing through the ball
  • Self-hosted MathJax with a CI external-host allowlist guard

Changed

  • All NN layers now take a param_dtype constructor argument (default jnp.float32) controlling the storage dtype of every trainable parameter and persistent state (batch-norm statistics, VQ codebooks, scalar scales/temperatures). The manifold's dtype controls compute precision only. Under global jax_enable_x64, parameters previously materialized as float64 (2× parameter/optimizer memory, float64 checkpoints); they now stay float32 unless param_dtype=jnp.float64 is passed explicitly. The Riemannian optimizers complete the contract: egrad2rgrad/expmap/ptransp run in the manifold dtype, but returned updates and momentum buffers are cast back to the parameter's storage dtype (previously a float32 ManifoldParam next to a float64 manifold silently promoted its optimizer state to float64 after one step). See Numerical Stability — Storage vs. Compute Dtype. Breaking changes:
    • FGGMeanOnlyBatchNorm(dtype=...) renamed to param_dtype=...
    • PoincareBatchNorm2D and HypVQEmbeddingPoincare state is no longer pinned to manifold.dtype — it defaults to float32; pass param_dtype=manifold.dtype to restore the old behavior
    • Checkpoints saved under global x64 before this change carry float64 leaves and will dtype-mismatch on restore into float32-storage modules — re-initialize or cast the state tree on load
  • Hyperboloid.addition now implements the Lorentz gyrovector addition x ⊕ y = Exp_x(PT_{0→x}(Log_0(y))) (Chen et al. 2025b; Shi et al. 2026, Eq. 1), and ProductManifold.addition delegates it per factor. It forms a gyrocommutative gyrogroup (identity = origin, inverse ⊖x = (-1) ⊙ x = [x₀, -x_s]) and coincides with Poincaré Möbius addition under the stereographic isometry. This replaces the earlier coordinate-wise formula, which was incorrect at every curvature (e.g. origin ⊕ y ≠ y) and failed silently via a trailing projection. Hyperboloid.scalar_mul (geodesic scaling, = Eq. 2) is unchanged. Breaking change — addition no longer raises NotImplementedError
  • Breaking: VERSION_LORENTZIAN_PROXY removed from the Poincaré manifold. The formula treated Poincaré ball coordinate 0 as a Lorentz time component, so it was only meaningful for hyperboloid inputs and returned dist(x, x) = -2/c ≠ 0 for ball points; the docs additionally mis-advertised it as "best near boundary". The reference implementation never had it. dist/dist_0 now select between 3 versions (VERSION_MOBIUS_DIRECT, VERSION_MOBIUS, VERSION_METRIC_TENSOR). For a true Lorentzian (squared Minkowski) proxy, convert to the hyperboloid via isometry_mappings.poincare_to_hyperboloid first

Fixed

  • Poincaré ↔ Hyperboloid isometry maps were only correct at c=1. poincare_to_hyperboloid / hyperboloid_to_poincare used unit-ball stereographic formulas missing their √c factors, so round-trips and distance preservation silently failed at any other curvature (the recommended default is c=0.1). Both are now curvature-correct at all c, verified by round-trip, isometry, commutative-diagram, and extreme-curvature tests across dtypes
  • Test fixture uniform_points generated hyperboloid points at the wrong geodesic radius for c ≠ 1 (an extra /√c on the spatial coordinate, masked by a trailing projection). Corrected so generated points are the exact Poincaré images at any curvature
  • Silent float64 promotion under x64 in hyperboloid layers. Runtime buffers created without an explicit dtype (FGGConv2D SAME/origin padding buffer, causal linear-attention scan carries, full-attention uniform head-averaging weights) now derive their dtype from the input, and the scalar attention parameters (temperature, scale, attn_bias) are cast to the compute dtype at use. Previously, with jax_enable_x64 active, these defaulted to float64 and promoted float32 activations through the rest of the layer

0.7.2 - 2026-05-22

Changed

  • ProductManifold curvature API redesigned — every geometry method (dist, expmap, logmap, proj, origin, tangent_inner, etc.) now takes a positional c argument that must be a sequence of length n_factors (one curvature per factor) instead of the silently-ignored scalar c. There is no default and no scalar broadcast: pass product.curvatures for static curvatures, or build the sequence from LearnableCurvature calls for trainable ones. The protocol-level Curvature type was widened to ScalarCurvature | Sequence[ScalarCurvature] so ProductManifold satisfies the Manifold protocol — isinstance(product, Manifold) is True and generic code typed against Manifold accepts product instances. The product still has no c attribute (use product.curvatures). Breaking change — call sites that passed c=0.0 (or any scalar) must now pass a per-factor sequence (c_0, c_1, …)

Fixed

  • Corrected the ProductManifold API examples and the protocol-conformance claim in the documentation

0.7.1 - 2026-05-21

Added

  • LearnableCurvature(nnx.Module) — canonical module for trainable curvature in hyperbolix.utils.curvature, also exported at top level (from hyperbolix import LearnableCurvature). Introduces the softplus (default, c = softplus(raw), bounded gradient via sigmoid — geoopt's Stereographic/PoincareBall convention, also the code default in the van Spengler et al. 2023 Poincare ResNet reference implementation) and log (c = exp(raw), scale-invariant gradient dc/draw = c, MERU convention, preferred for compiled RL loops) reparameterizations. The default clamp is applied to the recovered c (not the raw parameter) as a hard stability guard for long compiled training loops — [0.1, 10.0] for both schemes; pass c_min=None, c_max=None to disable. Updated by any standard Euclidean nnx.Optimizer — no Riemannian optimizer needed

Changed

  • Manifolds are now plain Python classes (not nnx.Module). This structurally prevents shared-manifold bugs in nnx.scan/nnx.fori_loop — manifolds become static graphdef attributes with no state pytree entries
  • learnable=True removed from manifold constructors. Use the LearnableCurvature module instead — assign one instance per distinct curvature on your model. See the Manifolds User Guide
  • ProductManifold is now a plain class; from_signature accepts 3- and 4-tuple specs only (5-tuple learnable override removed)
  • learnable_curvature() / get_curvature() functional helpers replaced by the LearnableCurvature(nnx.Module) class. The class bundles the raw parameter, reparameterization scheme, and clamp bounds in one object, making accidental init/recovery mismatches structurally impossible. Call sites change from c = get_curvature(self.c_raw) to c = self.curvature(). Breaking change — no deprecation shim

0.7.0 - 2026-05-18

Added

  • Product manifold (hyperbolix.manifolds.ProductManifold) — heterogeneous-curvature composition \(M_1 \times M_2 \times \dots \times M_n\) where each factor may be any base manifold with its own curvature (Gu et al. 2019). Points are flat concatenated arrays of shape (total_dim,); geometry methods take a per-factor curvature sequence as positional c at call time. Provides Pythagorean L2 geodesic distance plus auxiliary dist_l1 / dist_min / component_dist reductions, full per-factor decomposition of expmap/logmap/ptransp/proj/egrad2rgrad/tangent_inner, an origin(c) helper, and a from_signature factory accepting 3- and 4-tuple specs
  • Learnable curvature via an nnx.Module — first-class trainable curvature assigned per distinct curvature on the model (later canonicalized into LearnableCurvature in v0.7.1)

0.6.0 - 2026-04-20

Added

  • Proper Velocity (PV) manifold (hyperbolix.manifolds.ProperVelocity) — unconstrained \(\mathbb{R}^n\) model of hyperbolic geometry from Chen et al. (2026), with complete geometric operations: addition, scalar_mul, dist, expmap/logmap (at origin and arbitrary base points), ptransp/ptransp_0, egrad2rgrad, and Riemannian inner product
  • Proper Velocity neural-network layers:
    • HypLinearPV: PV fully-connected layer (Thm 5.3 / Eq. 22)
    • HypConv2DPV: PV 2D convolution with raw Euclidean patch concatenation (Sec 5.3) — no beta-scaling, dimension-preserving
    • HypRegressionPV: PV multinomial-logistic-regression head (Thm 5.2 / Eq. 19)

0.5.3 - 2026-04-14

Added

  • Hyperbolic average-pooling layer

0.5.2 - 2026-04-02

Added

  • HypLinearHyperboloidFHNN and HypConv2DHyperboloidFHNN layers (fully-hyperbolic neural network, Bdeir et al. 2023)

0.5.1 - 2026-03-27

Added

  • PoincareBatchNorm2D — Poincaré ball BatchNorm between conv layers (van Spengler et al. 2023)

0.5.0 - 2026-03-26

Removed

  • HypRegressionPoincareHDRL layer and its tests

0.4.2 - 2026-03-24

Changed

  • Removed HypConv3DHyperboloid; beta_scale is now wrapped in float

0.4.1 - 2026-03-19

Changed

  • Flattened conv-layer parameter paths via forward-function extraction (cleaner param trees, no behavior change)

0.4.0 - 2026-03-17

Added

  • MkDocs Material documentation system
  • Complete API reference documentation
  • Getting Started guide
  • CI/CD workflow for documentation builds

Changed

  • Adopted Flax NNX layer naming convention (kernel/bias) across all layers

0.3.0 - 2026-03-10

Added

  • FGG-LNN layers (FGGLinear, FGGConv2D, FGGLorentzMLR) — fully-generalized Lorentz layers (Klis et al. 2026)

0.2.1 - 2026-03-06

Changed

  • Migrated benchmarks to Grain data loading

0.2.0 - 2026-03-05

Added

  • Class-based manifold API with automatic dtype casting (Poincare, Hyperboloid, Euclidean)
  • Manifold structural protocol for type-safe manifold dispatch
  • Poincaré convolution layers
  • Positional encoding layers for hyperbolic Transformers:
    • lorentz_residual: Lorentzian midpoint-based residual connection
    • hope: Hyperbolic Rotary Positional Encoding (functional)
    • HyperbolicRoPE: NNX module wrapper for HOPE
    • HypformerPositionalEncoding: Learnable positional encoding with HTCLinear
  • Causal attention masking (causal=True) for all three hyperbolic attention variants:
    • HyperbolicSoftmaxAttention: lower-triangular -inf mask before softmax
    • HyperbolicFullAttention: lower-triangular -inf mask on Lorentzian similarity scores
    • HyperbolicLinearAttention: O(N) cumulative-sum recurrence via jax.lax.scan (Katharopoulos et al. 2020), keeping O(N) complexity in causal mode
  • Tiny Shakespeare character-level benchmark (benchmarks/bench_shakespeare_attention.py) comparing all four model variants (Euclidean + 3 hyperbolic) with causal attention

Changed

  • Breaking: Manifold public functions renamed to private (dist() → _dist()); use class methods instead
  • Replaced with_precision() wrapper with the Poincare(dtype=jnp.float64) pattern
  • Breaking: HypformerPositionalEncoding.epsilon is no longer a learnable nnx.Param — it is a fixed, non-negative constructor float (default 1.0), matching the Hypformer reference (which keeps it a plain non-trainable tensor). A learnable epsilon could be driven below -1 by gradient descent, where x + epsilon * p leaves the upper hyperboloid sheet and the abs() in the lorentz_residual normalizer silently masks the violation. lorentz_residual now documents the w_y >= 0 requirement

0.1.4 - 2026-02-10

Added

  • Pure JAX implementation of hyperbolic manifolds (Euclidean, Poincaré, Hyperboloid)
  • 13+ neural network layers (linear, convolutional, regression)
  • Hypformer components: HTC/HRC with curvature-change support
  • 4 hyperbolic activation functions (ReLU, Leaky ReLU, Tanh, Swish)
  • Riemannian optimizers (RSGD, RAdam) with automatic manifold detection
  • Isometry mappings between the Poincaré ball and hyperboloid models
  • Wrapped normal distributions for VAEs
  • Comprehensive test suite (1,400+ tests)
  • CI/CD pipeline with benchmarking
  • vmap-native API design

Changed

  • Migrated from PyTorch to pure JAX/Flax NNX
  • Unified package structure: hyperbolix_jax → hyperbolix

References

  • Based on research by Ganea et al. (2018), Bécigneul & Ganea (2019), Bdeir et al. (2023)