Skip to content

Release v0.4.0 (integration of #53–#57 + coverage) - #58

Merged
johmathe merged 2 commits into
mainfrom
johmathe/release-0.4.0
Oct 14, 2026
Merged

johmathe merged 2 commits into
mainfrom
johmathe/release-0.4.0

Conversation

@johmathe

@johmathe johmathe commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Integration PR for v0.4.0. Merges the five fix branches, bumps the version, adds versionchanged notes to the three affected class docstrings, and carries the coverage work.

Status: #53–#57 are merged. This PR is now just the version bump, the versionchanged docstring notes, and the coverage commit, rebased onto main.

Stack

PR Branch Fixes
#53 fix-bessel-j0-j1-accuracy torch.special J₀/J₁ were ~5e-7 accurate; Miller recurrence for all orders
#54 fix-disk-basis-conditioning (on #53) SO2onDisk default basis cond ~1e16 → ≈2 (Nyquist band-limit)
#55 fix-dn-odd-n-fold DnonDn dropped the fold block for odd n ≥ 5; invariant was incomplete
#56 fix-so3-selective-rank SO3onS2 selective map rank-deficient for L ≥ 8; CUDA-graph cache key
#57 fix-minor-numerics rotation float64 path, CnonCn.invert pivots, OctaonOcta._lm_step acceptance

Breaking changes (0.4.0)

output_size / feature layout changes for SO3onS2 (all lmax ≥ 3; L=16: 430 → 426), DnonDn (odd n ≥ 5; +16 entries) and the default SO2onDisk truncation (L=16: 105 → 76). Cached features and heads trained on the old layouts must be recomputed. The on-disk sparse CG cache self-invalidates.

Coverage (8a469f4)

Local pytest --cov=src/bispectrum: 95.6% → 98.6% (31/2181 statements missing), no pragma: no cover.

  • Removed dead code: scalar _bisect_newton/_jn_scalar/_djn_scalar, unreachable num_brackets <= 0, n2d == 0/n3 == 0, and an empty-slice guard in the SO3 power loop.
  • Bug found by the new tests: _load_or_compute_reduced_cg didn't catch pickle.UnpicklingError; a corrupt reduced-CG cache file crashed SO3onS2 construction.
  • New tests: version fallback; dense-vs-sparse selective parity (incl. CG power); reduced-CG disk cache compute/load/corrupt/write-failure; CUDA-graph capture wiring with torch.cuda stubbed on CPU; triangle-violating CG triples; order-0 batch roots.
  • Remaining uncovered: defensive numerical fallbacks in the D_n / octahedral CG constructions and the f.is_cuda dispatch.

Verification

747 passed / 23 skipped, pre-commit --all-files clean, benchmarks/verify_linear_bootstrap.py --lmax 100 ALL PASSED.

Follow-ups (not in this stack)

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.57%. Comparing base (0744394) to head (f03227c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
+ Coverage   95.61%   98.57%   +2.96%     
==========================================
  Files          11       11              
  Lines        2235     2181      -54     
==========================================
+ Hits         2137     2150      +13     
+ Misses         98       31      -67     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Bump version to 0.4.0 and record the feature-layout changes in the
SO3onS2, DnonDn and SO2onDisk class docstrings (versionchanged notes).

Breaking: output_size / layout changes for SO3onS2 (lmax >= 3), DnonDn
(odd n >= 5) and the default SO2onDisk truncation.
…ph wiring

Dead code removed (never reachable from the library):
* _bessel: scalar _jn_scalar/_djn_scalar/_bisect_newton (only tests used
  them; the batch solver is the single root path) and the unreachable
  num_brackets <= 0 branch in compute_all_bessel_roots.
* dn_on_dn: n2d == 0 / n3 == 0 branches (n >= 3 implies n2d >= 1).
* so3_on_s2: empty-slice guard in the power loop of
  _ensure_precomputed_on_device (empty entries are never flagged power).

Bug found by the new tests: _load_or_compute_reduced_cg did not catch
pickle.UnpicklingError, so a corrupt reduced-CG cache file crashed module
construction instead of being recomputed.

New tests: package version fallback; _bessel_jn_multi(()) and order-0
batch roots; _save_cache write failure; triangle-violating sparse CG
entries (empty tables, exact zeros in forward); SO3onS2 dense tables vs
sparse forward (incl. CG power); reduced-CG disk cache compute/load/
corrupt/write-failure paths; lazy sparse gather-table construction; CUDA
graph capture wiring with torch.cuda stream/graph APIs stubbed on CPU.

Remaining uncovered lines are defensive numerical fallbacks in the D_n /
octahedral CG constructions and the CUDA dispatch in SO3onS2.forward.
@johmathe
johmathe force-pushed the johmathe/release-0.4.0 branch from 8a469f4 to f03227c Compare October 14, 2026 16:48
@johmathe
johmathe merged commit e9b8773 into main Oct 14, 2026
2 checks passed
@johmathe
johmathe deleted the johmathe/release-0.4.0 branch October 14, 2026 16:51
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