Skip to content

feat(linalg): add zero-dependency cholesky decomposition and unit tests#51

Merged
erfanjazebnikoo merged 1 commit into
NIKX-Tech:devfrom
erfanili:feature/cholesky-decomposition
Jul 9, 2026
Merged

feat(linalg): add zero-dependency cholesky decomposition and unit tests#51
erfanjazebnikoo merged 1 commit into
NIKX-Tech:devfrom
erfanili:feature/cholesky-decomposition

Conversation

@erfanili

@erfanili erfanili commented Jul 8, 2026

Copy link
Copy Markdown

Reference Issues/PRs

What does this implement/fix? Explain your changes.

Implements the Cholesky Decomposition algorithm (A = L * L^T) for real symmetric positive-definite matrices within the core linear algebra module.

Key changes:

  • Core Logic: Added numx_cholesky_decompose to src/linalg.c utilizing a row-major execution layout.

Any other comments?

@erfanjazebnikoo
erfanjazebnikoo changed the base branch from main to dev July 8, 2026 21:34
@erfanjazebnikoo
erfanjazebnikoo merged commit 73a7610 into NIKX-Tech:dev Jul 9, 2026
8 checks passed
erfanjazebnikoo added a commit that referenced this pull request Jul 9, 2026
Adds the pieces every other function in this library has, on top of the
implementation and tests from #51 (Erfan Esmaeili):

- docs/algorithms/linalg.md: math formulation, complexity row, when
  to/not to use (including the symmetry-not-checked caveat)
- validation/c/val_runner.c: benchmark + correctness check, same textbook
  matrix as the unit tests
- validation/results/linalg/cholesky_decompose.md: first validation pass
  (ARM64/Apple M4 Pro, ASan/UBSan clean, both precisions), flagged as
  needing the full platform sweep before it matches the rest of linalg
- README.md and CHANGELOG.md updated to mention the function

Verified before committing: clean build, 335/335 tests (329 base + 6
Cholesky), ASan/UBSan clean, strict -Wall -Wextra -Werror clean in both
float32 and float64.
@erfanjazebnikoo

Copy link
Copy Markdown
Member

Thank you for this, genuinely solid work. Correct Cholesky-Banachiewicz factorization, verified against the textbook example, and the L·L^T reconstruction test are a really nice touch; they check the actual math rather than just a hardcoded expected output. Compiles cleanly under our strictest flags (-Wall -Wextra -Werror -pedantic-errors) in both float32 and float64, and passes under AddressSanitizer and UndefinedBehaviorSanitizer with zero issues.

Merged into dev. I added the benchmark, docs page, and validation entry for every function in this library (see #52), and added you to CONTRIBUTORS.md. Sending it out for validation across the rest of our hardware next (Raspberry Pi, ESP32, Windows), then it ships in the next release with your name on the commit.

Would genuinely welcome more contributions if you're interested; CONTRIBUTING.md has the pattern we follow.

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