Skip to content

Conversation

@igerber
Copy link
Owner

@igerber igerber commented Jan 17, 2026

No description provided.

igerber and others added 3 commits January 17, 2026 09:27
Bootstrap weight generation (16x average speedup):
- Direct Array2 allocation eliminates Vec<Vec<f64>> intermediate
- Rayon chunk size tuning (min_len=64) reduces scheduling overhead
- Webb distribution uses lookup table instead of 6-way if-else

Linear algebra optimizations:
- Cholesky factorization for SPD matrix inversion with LU fallback
- Vectorized HC1 meat computation: X' @ (X * e²) via BLAS
- Vectorized score computation: broadcast multiplication

Static BLAS linking options:
- Added openblas-static and intel-mkl-static features for distribution

Benchmark results (release build, Apple Silicon):
- Bootstrap Rademacher: 6-14x speedup
- Bootstrap Mammen: 11-24x speedup
- Bootstrap Webb: 12-32x speedup
- OLS (small <1K obs): 2-3x speedup
- OLS (large >10K obs): 0.3-0.7x (Apple Accelerate faster)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update version to 2.0.3 in pyproject.toml, __init__.py, Cargo.toml
- Add CHANGELOG entry documenting Rust backend optimizations
- Update TODO.md to mark Rust optimizations as completed in v2.0.3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests verify that when Cholesky factorization fails due to near-singular
or high condition number matrices, the Rust backend correctly falls back
to LU decomposition:

- test_near_singular_matrix_lu_fallback: Near-collinear design matrix
- test_high_condition_number_matrix: Extreme column scaling
- test_near_singular_with_clusters: Near-singular with cluster-robust SEs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@igerber igerber merged commit 35c725f into main Jan 17, 2026
4 checks passed
@igerber igerber deleted the rust-backend-optimizations branch January 17, 2026 14:45
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.

2 participants