-
Notifications
You must be signed in to change notification settings - Fork 12
Add Windows wheel builds using faer pure Rust linear algebra #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Replace ndarray-linalg (which requires OpenBLAS/MKL) with faer, a pure Rust linear algebra library with no external dependencies. This enables Windows wheel builds without complex BLAS/LAPACK CI configuration. Changes: - rust/Cargo.toml: Add faer 0.24, faer-ext 0.7; update pyo3 to 0.22, numpy to 0.22, ndarray to 0.16; remove platform-conditional deps - rust/src/linalg.rs: Replace ndarray-linalg SVD/LU with faer equivalents - rust/src/trop.rs: Update soft_threshold_svd() to use faer SVD - rust/src/*.rs: Update for PyO3 0.22 API (Bound<> return types) - .github/workflows/rust-test.yml: Add Windows to CI matrix - .github/workflows/publish.yml: Add Windows wheel build job All 1091 Python tests pass. All 62 Rust backend equivalence tests pass. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Overall Assessment
Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
The macOS runner has Python 3.14 installed by default, but PyO3 0.22.6 only supports up to Python 3.13. Setting this env var tells PyO3 to build using the stable ABI, which is forward-compatible. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
For underdetermined systems (n < k), thin SVD returns: - U: (n, n) - S: (n,) - only n singular values - V: (k, n) - only n right singular vectors The bug was creating s_inv_uty with size k instead of s.len()=min(n,k), causing a dimension mismatch in the dot product vt.t().dot(&s_inv_uty). Fix: Use s.len() for s_inv_uty array size, which correctly handles both overdetermined (n >= k) and underdetermined (n < k) cases. Addresses P1 bug identified in PR #115 code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment: Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Open Questions/Assumptions
Executive Summary
|
- Add residual-based verification to invert_symmetric (||A*A^{-1} - I||)
to catch near-singular matrices that produce finite but inaccurate results
- Use threshold of 1e-4 * n to allow ill-conditioned but valid matrices
while catching truly pathological cases
- Add unit tests for singular and near-singular matrix inversion
- Remove unused faer-ext dependency from Cargo.toml
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Executive Summary
|
P0: Return f64::NAN instead of 0.0 in TROP bootstrap when < 2 samples P1: Add Python fallback in _solve_ols_rust for numerical instability P2: Gate expensive O(n³) residual check behind LU pivot ratio detection Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment: Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Open Questions/Assumptions
Change Summary
|
- P1: solve_ols(skip_rank_check=True) now checks for None return from Rust and falls through to NumPy on numerical instability - P2: compute_robust_vcov now catches "numerically unstable" errors and falls back to NumPy instead of propagating the error - Remove PyO3-dependent tests from Rust that caused cargo test to fail without Python initialization Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment: Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
…llback Address PR #115 review round 3: - P2: Add UserWarning when Rust backend falls back to Python on numerical instability - P3: Add test_numerical_instability_fallback_warns to verify warning and fallback behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment: ✅ Looks good Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Open Questions
Executive Summary
|
Summary
Methodology references (required if estimator / math changes)
Validation
Security / privacy
Generated with Claude Code