Skip to content

Feat sprs transition - #11

Merged
ianfd merged 18 commits into
masterfrom
feat-sprs-transition
Aug 4, 2026
Merged

Feat sprs transition#11
ianfd merged 18 commits into
masterfrom
feat-sprs-transition

Conversation

@ianfd

@ianfd ianfd commented Aug 4, 2026

Copy link
Copy Markdown
Member

No description provided.

ian and others added 18 commits March 31, 2026 13:33
Implements all SMat<T> methods for sprs::CsMatI<T,I,Iptr>:
- svd_opa (CSR/CSC × forward/transposed, parallel chunked scatter)
- compute_column_means
- multiply_with_dense (4 branches, parallel)
- multiply_with_dense_centered (correct dot-product formula, avoids product-of-sums bug)
- multiply_transposed_by_dense
- multiply_transposed_by_dense_centered

15 unit tests cover CSR and CSC paths for all 6 methods.

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

All tests that used CsrMatrix (nalgebra) now use sprs::CsMat<f64> via
TriMat construction, eliminating the todo!() panics from the unimplemented
nalgebra SMat methods.

Also fix u/vt dimension assertions in test_random_svd_computation:
u is (nrows × rank), not transposed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove erroneous || (nrows < 1000 && ncols < 1000) condition from
svd_opa that bypassed column masking for small matrices, causing panics
when x was sized for masked columns but underlying matrix expected full
column count.

Fix test_masked_vs_physical_subset to use svd_dim_seed with identical
seed for both masked and physical SVDs, ensuring deterministic comparison.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New src/lanczos/masked_sprs.rs with MaskedCsMatI<T,I,Iptr> (alias
MaskedCsMat<T>): wraps a sprs::CsMatI reference with a column mask,
implementing all SMat<T> methods without the small-matrix fast-path
bypass that caused the original MaskedCSRMatrix bug.

17 unit tests cover both CSR and CSC paths for all 6 SMat methods
plus an end-to-end SVD comparison against a physical sparse subset.

Also fix setup_thread_pool() in randomized tests to tolerate a
pre-initialized Rayon global pool (avoids Once poisoning race).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove setup_thread_pool()/build_global() which caused Once poisoning
when other tests triggered Rayon's lazy global init first. Each test
now builds its own local ThreadPool and uses pool.install() to scope
parallel work, eliminating all shared global state between tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New ci.yml runs cargo test on every push/PR to master, providing the
status check needed for branch protection rules.

publish.yml now triggers only on release publication (not every master
push), so crates.io publishing is intentional and release-gated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…en LAS2 and randomized algorithms. Add reconstruction property tests.
@ianfd
ianfd merged commit 769f48e into master Aug 4, 2026
3 checks passed
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