Skip to content

release: cut v0.1.2 - #116

Merged
t-uda merged 90 commits into
mainfrom
ellphi-0.1.2
Mar 25, 2026
Merged

release: cut v0.1.2#116
t-uda merged 90 commits into
mainfrom
ellphi-0.1.2

Conversation

@t-uda

@t-uda t-uda commented Mar 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • merge the 0.1.2 release branch into main
  • include the final 0.1.2 version bump and dated release notes
  • ship the validated docs / packaging / workflow updates collected on ellphi-0.1.2

Notes

  • tag v0.1.2 should be created from main after this PR merges

t-uda and others added 30 commits December 30, 2025 12:22
…y calculations with in-place operations and pre-allocated buffers.
…update benchmark script, and add `_u_from_x` stub.
…sed by `target` and `target_prime`, including Cholesky factorization and degenerate case handling.
Introduces tangency_grad (single-pair gradient via envelope theorem) and
pdist_tangency_grad (batch VJP pullback) as first-class public API.
Includes 7 tests verifying analytic gradients against finite differences,
and a topology-optimisation notebook demonstrating scipy L-BFGS-B usage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add t=0 guard in tangency_grad to handle zero-distance (identical/
  concentric) ellipsoid pairs without raising ZeroDivisionError
- Mirror TangencyGrad, tangency_grad, pdist_tangency_grad in __init__.pyi
  so stubtest and typed imports work correctly
- Fix notebook: use correct coef_from_axes(X, r0, r1, theta) API; replace
  unstable live optimization with a commented-out scipy wiring template

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The condition t == 0.0 is only reachable when p == q exactly, which is
not a valid input. Removing the guard keeps the code honest.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y_grad

Explains why identical/concentric ellipsoids raise, which formula term
is ill-defined, and why the error comes from solve_mu_gradients rather
than the 1/(2t) factor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the placeholder in the topology optimisation notebook with a
working example that drives gradient descent on ellipsoid centres using
an H1 persistence-diagram loss computed by homcloud.

Key design decisions (reviewed and approved by a mathematician):
- Flag (clique) filtration on the tangency-distance matrix, framed as
  PH of a weighted dissimilarity graph (not metric VR PH, since t(P,Q)
  fails the triangle inequality in general).
- Single H1 pair loss: L = (b - b*)^2 + (d - d*)^2 with a feasible
  target delta = min(0.2, 0.25*(d0-b0)).
- Centre-only optimisation with fixed covariance preserves ellipsoid
  validity automatically; full raw-coefficient updates are avoided.
- Gradient chain: grad_dists (sparse, float32-selected critical edges)
  -> vjp -> grad_coefs -> centre Jacobian J^T g.
- find_unique_edge scans the float32 D matrix for unique birth/death
  edge matches; non-unique match stops the loop (degenerate step).
  homcloud 4.8.0 does not expose birth/death simplex vertex indices for
  Rips filtrations (RipsResolver.resolve_cells unimplemented), so this
  scan is the correct fallback under generic-position assumption.
- Loop uses ordinary gradient descent on each locally smooth branch;
  heuristic continuation at pairing-switch events is documented.
- Float32 approximation note: critical edges are selected from the
  float32 matrix but VJP pullback uses float64 tangency distances.

Also removes the unused scipy.optimize boilerplate cell from Section 2.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- tangency_grad: normalize p/q with asarray+reshape(-1) before use,
  matching tangency()'s own input handling so list and row-vector inputs
  work correctly
- pdist_tangency_grad: use _extract_coef_array() instead of plain
  asarray() to accept (N,1,m) arrays the same way pdist_tangency() does
- Add three tests covering list, (1,m), and (N,1,m) input shapes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Import _extract_coef_array was flagged by mypy because the symbol is
absent from solver.pyi. Inline the equivalent logic instead, preserving
the (N,1,m) flattening and the ndim != 2 rejection that guards the VJP
against unsupported array layouts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
t-uda and others added 27 commits March 22, 2026 08:34
Adds coef_from_cov_grad(X, cov, *, scale) -> (coefs, vjp) to the grad
module. The VJP maps upstream gradients on packed coefficients back to
gradients on centers (N, d) and covariances (N, d, d) via the matrix
inverse derivative identity. Works for arbitrary dimension d.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add end-to-end gradient recipe and conceptual background for the new
differentiable geometry helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add coef_from_cov_grad: differentiable geometry with VJP
Add batch-size, squareness, and dimensionality checks matching
coef_from_cov() so malformed inputs raise ValueError instead of
silently broadcasting or returning NaN. Singular but well-formed
covariances now return NaN coefficients with zero-gradient VJP,
matching the forward-only fallback behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover the new validation paths: batch size mismatch, non-square
covariance, dimension mismatch (all ValueError), and singular
covariance returning NaN with zero-gradient VJP.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Zero gradients falsely signal a stationary point to optimisers.
NaN gradients are consistent with the NaN coefficients and correctly
indicate an undefined derivative.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix coef_from_cov_grad: validate inputs and handle singular covariances
feat: add direct ellipse cloud construction helpers
docs: curate unreleased release notes
Fix grad symmetry and release metadata gaps
release: bump version to 0.1.2
@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@t-uda
t-uda merged commit 303f796 into main Mar 25, 2026
12 checks passed
@t-uda
t-uda deleted the ellphi-0.1.2 branch March 26, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant