Skip to content

Replaced unsafe ptr logic with chained split_at_mut in DenseMatrix an…#371

Open
jackpots28 wants to merge 3 commits into
smartcorelib:developmentfrom
jackpots28:issue-368-enhancement
Open

Replaced unsafe ptr logic with chained split_at_mut in DenseMatrix an…#371
jackpots28 wants to merge 3 commits into
smartcorelib:developmentfrom
jackpots28:issue-368-enhancement

Conversation

@jackpots28
Copy link
Copy Markdown

…d DenseMatrixMutView

Fixes #368

Checklist

  • [ x ] My branch is up-to-date with development branch.
  • [ x ] Everything works and tested on latest stable Rust.
  • [ x ] Coverage and Linting have been applied

Current behaviour

Changing DenseMatrix and DenseMatrixMutView that uses unsafe ptr arithmetic for generating mutable iterators

New expected behavior

DenseMatrix and DenseMatrixMutView continue to produce mutable iterators, but uses a "head" / "tail" method + split_at_mut function for iterating

  • no test changes required

Change logs

  • Replaced unsafe pointer arithmetic in DenseMatrix / DenseMatrixMutView mutable iterators with a safe, chained split_at_mut implementation to ensure memory safety without performance loss.

@jackpots28 jackpots28 requested a review from Mec-iS as a code owner May 20, 2026 20:42
@Mec-iS
Copy link
Copy Markdown
Collaborator

Mec-iS commented May 20, 2026

thank you!

please run cargo fmt --all -- --check and the other checks needed.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 27.27273% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.15%. Comparing base (70d8a0f) to head (64b90c5).
⚠️ Report is 17 commits behind head on development.

Files with missing lines Patch % Lines
src/linalg/basic/matrix.rs 27.27% 80 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #371      +/-   ##
===============================================
- Coverage        45.59%   44.15%   -1.45%     
===============================================
  Files               93       94       +1     
  Lines             8034     8097      +63     
===============================================
- Hits              3663     3575      -88     
- Misses            4371     4522     +151     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jackpots28
Copy link
Copy Markdown
Author

I updated the formatting and caught the issue with sort_by that clippy complained about. Test coverage is still slightly lower "src/linalg/basic/matrix.rs: 225/364" | "59.72% coverage, 5238/8771 lines covered", should I add some tests for more coverage?

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.

tech-debt: replace unsafe raw-pointer iterator_mut in DenseMatrix (basic/matrix.rs) with safe split_at_mut approach

2 participants