Skip to content

Fix UMAP crashes: upgrade annembed and add panic safety#17

Merged
cpetersen merged 1 commit intomainfrom
fix/lapack-sgesdd-layout
Mar 26, 2026
Merged

Fix UMAP crashes: upgrade annembed and add panic safety#17
cpetersen merged 1 commit intomainfrom
fix/lapack-sgesdd-layout

Conversation

@cpetersen
Copy link
Copy Markdown
Member

Summary

  • Upgrade annembed dependency from clusterkit-0.1.1 to clusterkit-0.2.6, which fixes multiple UMAP embedding crashes (see scientist-labs/annembed#9)
  • Wrap embedder.embed() in catch_unwind so any remaining Rust panics become Ruby RuntimeError exceptions instead of killing the process

Bugs fixed in annembed clusterkit-0.2.6

  1. LAPACK SGESDD parameter 12 crash — SVD received wrong matrix layout (Fortran data declared as C-order)
  2. ndarray index-out-of-bounds in diffusion maps — off-by-one when accessing eigenvectors/eigenvalues with [j+1] offset
  3. Dimension mismatch in entropy optimizationasked_dim used to read vectors that could have fewer columns
  4. Empty neighbor array panics — unguarded neighbours[0] access

Test plan

  • Rust tests pass: cargo test --no-default-features --features macos-accelerate (2 passed)
  • Ruby specs pass: bundle exec rspec (465 passed, 0 failures)
  • End-to-end: ragnar umap train with 6938 embeddings (768 dims) completes successfully
  • Previously crashed with both LAPACK fatal error and index-out-of-bounds panic

🤖 Generated with Claude Code

- Update annembed dependency to clusterkit-0.2.6 tag which fixes:
  - LAPACK SGESDD crash from incorrect matrix layout declaration
  - ndarray index-out-of-bounds in diffusion map embedding
  - Dimension mismatch between initial embedding and optimization
  - Empty neighbor array panics
- Wrap embedder.embed() in catch_unwind so Rust panics become Ruby
  exceptions instead of process crashes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cpetersen cpetersen merged commit f7e8923 into main Mar 26, 2026
1 check passed
@cpetersen cpetersen deleted the fix/lapack-sgesdd-layout branch March 26, 2026 02: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