Skip to content

builtins: add solve inv det via LU decomposition#199

Merged
danieljohnmorris merged 1 commit into
mainfrom
fix/linalg-advanced
May 12, 2026
Merged

builtins: add solve inv det via LU decomposition#199
danieljohnmorris merged 1 commit into
mainfrom
fix/linalg-advanced

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

With transpose/matmul/dot landed, the next numeric layer needs solve, inverse, determinant.

Implementation:

  • shared LU decomposition with partial pivoting
  • one routine plus three thin entry points
  • singular and non-square matrices error with a clear message
  • singularity tolerance fixed at 1e-12
  • opcodes allocated: solve, inv, det

Tests: cross-engine regression tests + examples/linalg-advanced.ilo with -- run: directives.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

❌ Patch coverage is 73.73358% with 140 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/interpreter/mod.rs 72.53% 53 Missing ⚠️
src/verify.rs 37.93% 36 Missing ⚠️
src/vm/mod.rs 86.01% 27 Missing ⚠️
src/vm/compile_cranelift.rs 20.00% 24 Missing ⚠️

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris force-pushed the fix/linalg-advanced branch 3 times, most recently from b70cbf8 to f27beed Compare May 12, 2026 23:15
With transpose/matmul/dot landed, the next layer of numeric work
needs linear system solve, matrix inverse, and determinant. All
three share an LU decomposition with partial pivoting, so the
implementation is one routine plus three thin entry points.

Opcodes allocated: solve, inv, det. Singular and non-square
matrices error with a clear message. Numerical tolerance is
fixed at 1e-12 for the singularity check.
@danieljohnmorris danieljohnmorris merged commit d792b53 into main May 12, 2026
4 checks passed
@danieljohnmorris danieljohnmorris deleted the fix/linalg-advanced branch May 12, 2026 23:23
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