Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
fa802d2
build(deps): update nalgebra requirement from 0.23.0 to 0.26.2 (#98)
dependabot-preview[bot] May 11, 2022
4e94feb
Update nalgebra requirement from 0.23.0 to 0.31.0 (#128)
dependabot[bot] May 11, 2022
ea39024
Add SVC::decision_function (#135)
ferrouille Jun 21, 2022
98e3465
Fix clippy warnings (#139)
morenol Jul 14, 2022
eb4b49d
Added additional doctest and fixed indices (#141)
cmccomb Aug 12, 2022
dc7f01d
Implement fastpair (#142)
Mec-iS Aug 23, 2022
09d9205
Add example for FastPair (#144)
Mec-iS Aug 24, 2022
df766ea
Implementation of Standard scaler (#143)
titoeb Aug 26, 2022
01f753f
Add serde for StandardScaler (#148)
ckatsak Sep 6, 2022
44e4be2
Update criterion requirement from 0.3 to 0.4 (#150)
dependabot[bot] Sep 12, 2022
0f442e9
Handle multiclass precision/recall (#152)
montanalow Sep 13, 2022
1f2597b
grid search (#154)
montanalow Sep 19, 2022
2d75c2c
Implement a generic read_csv method (#147)
titoeb Sep 19, 2022
f291b71
fix: fix compilation warnings when running only with default features…
morenol Sep 19, 2022
0d996ed
Update LICENSE
Mec-iS Sep 19, 2022
851533d
Make rand_distr optional (#161)
morenol Sep 20, 2022
bb5b437
feat: allocate first and then proceed to create matrix from Vec of Ro…
morenol Sep 20, 2022
cfa824d
Provide better output in flaky tests (#163)
morenol Sep 20, 2022
55e1158
Complete grid search params (#166)
montanalow Sep 21, 2022
a37b552
Lmm/add seeds in more algorithms (#164)
morenol Sep 21, 2022
05dfffa
add seed param to search params (#168)
montanalow Sep 21, 2022
f4fd4d2
make default params available to serde (#167)
montanalow Sep 22, 2022
e4c47c7
Add contribution guidelines (#178)
Mec-iS Sep 27, 2022
9ea3133
Update CONTRIBUTING.md
Mec-iS Sep 27, 2022
ad2e6c2
feat: expose hyper tuning module in model_selection (#179)
morenol Oct 1, 2022
473cdfc
refactor: Try to follow similar pattern to other APIs (#180)
morenol Oct 1, 2022
d520007
fix: fix issue with iterator for svc search (#182)
morenol Oct 2, 2022
d015b12
Update CONTRIBUTING.md
Mec-iS Oct 12, 2022
3b1aaaa
Update README.md
Mec-iS Oct 13, 2022
f605f6e
Update README.md
Mec-iS Oct 18, 2022
a32eb66
Dataset doc cleanup (#205)
rnowling Oct 30, 2022
a7fa058
Merge potential next release v0.4 (#187) Breaking Changes
Mec-iS Oct 31, 2022
d91f4f7
Update README.md
Mec-iS Oct 31, 2022
a16927a
Port ensemble. Add Display to naive_bayes (#208)
Mec-iS Oct 31, 2022
4d36b7f
Fix metrics::auc (#212)
Mec-iS Nov 1, 2022
712c478
Improve features (#215)
Mec-iS Nov 1, 2022
8f1a7df
build: fix compilation without default features (#218)
morenol Nov 2, 2022
7f35dc5
Disambiguate distances. Implement Fastpair. (#220)
Mec-iS Nov 2, 2022
c45bab4
Support Wasi as target (#216)
Mec-iS Nov 2, 2022
551a6e3
clean up svm
Mec-iS Nov 2, 2022
1cbde3b
Refactor modules structure in src/svm
Mec-iS Nov 2, 2022
6624732
Fix svr tests (#222)
Mec-iS Nov 3, 2022
e09c4ba
Add kernels' parameters to public interface
Mec-iS Nov 3, 2022
19f3a2f
Fix signature of metrics tests
Mec-iS Nov 3, 2022
ee6b6a5
cargo clippy
Mec-iS Nov 3, 2022
fabe362
Implement Display for NaiveBayes
Mec-iS Nov 3, 2022
b427e5d
Improve options conditionals
Mec-iS Nov 3, 2022
ed9769f
Implement CSV reader with new traits (#209)
Mec-iS Nov 3, 2022
ba27dd2
Fix CI (#227)
morenol Nov 3, 2022
8d07efd
Use Box in SVM and remove lifetimes (#228)
morenol Nov 4, 2022
d8d0fb6
Update README.md
Mec-iS Nov 4, 2022
6c0fd37
Update README.md
Mec-iS Nov 4, 2022
0dc97a4
Create DEVELOPERS.md
Mec-iS Nov 4, 2022
2df0795
Release 0.3
Mec-iS Nov 7, 2022
5b517c5
minor fix
Mec-iS Nov 7, 2022
527477d
minor fixes
Mec-iS Nov 7, 2022
3ec9e4f
Exclude datasets test for wasm/wasi
Mec-iS Nov 7, 2022
6d529b3
Add static analyzer to doc
Mec-iS Nov 7, 2022
669f87f
Use getrandom as default (for no-std feature)
Mec-iS Nov 8, 2022
a449fdd
fmt
Mec-iS Nov 8, 2022
616e38c
cleanup
Mec-iS Nov 8, 2022
af0a740
Fix std_rand feature
Mec-iS Nov 8, 2022
890e9d6
minor fix
Mec-iS Nov 8, 2022
63ed89a
minor fix
Mec-iS Nov 8, 2022
cf751f0
minor fix
Mec-iS Nov 8, 2022
c1bd1df
minor fix
Mec-iS Nov 8, 2022
1b7dda3
minor fix
Mec-iS Nov 8, 2022
459d558
minor fixes to doc
Mec-iS Nov 8, 2022
fa54d5e
Remove unused tests flags
Mec-iS Nov 8, 2022
c507d97
Update CHANGELOG
Mec-iS Nov 8, 2022
b0dece9
use getrandom/js
Mec-iS Nov 8, 2022
2f6dd13
update comment
Mec-iS Nov 8, 2022
e25e2ae
update CHANGELOG
Mec-iS Nov 8, 2022
265fd55
make work cargo build --target wasm32-unknown-unknown
Mec-iS Nov 8, 2022
7d87451
Fixes for release (#237)
morenol Nov 8, 2022
62de25b
Handle kernel serialization (#232)
morenol Nov 8, 2022
0c9c70f
Merge
Mec-iS Nov 9, 2022
58a8624
v0.4.8 (#345)
Mec-iS Nov 29, 2025
78f1850
fix LASSO (#346)
georeth Dec 5, 2025
c57a437
bump version tp 0.4.9
Mec-iS Jan 9, 2026
ff2f75f
Update formatting command in CONTRIBUTING.md (#359)
Mec-iS Mar 10, 2026
c77781b
added Jaccard distance (#358)
skywardfire1 Mar 10, 2026
8f5769f
in cover_tree.rs i64::MIN - 1 causes overflow. FIXED. (#361)
skywardfire1 Mar 19, 2026
bc7c385
predict_proba functionality for kNN. Small bugfix. More concise and e…
skywardfire1 Mar 23, 2026
0569813
XGBoost: Do not panic if a tree split is degenerate (#364)
Dig-Doug Apr 2, 2026
a70676d
bump version
Mec-iS Apr 2, 2026
4c275d7
security: harden core data-path against OOM, UB, NaN, and integer-ove…
Mec-iS Apr 11, 2026
66f77af
chore: bump rand to 0.10.1, rand_distr to 0.5, getrandom to 0.3 (#369)
Mec-iS Apr 11, 2026
9dd5411
bump to v0.5.0
Mec-iS Apr 15, 2026
bbfee21
Update itertools requirement from 0.13.0 to 0.15.0 (#372)
dependabot[bot] Jun 17, 2026
938696a
Fix ROC AUC computation for tied prediction scores (#374)
teddytennant Jul 8, 2026
9ed0e63
fix(auc+encoder): review follow-ups from #374, clippy fix, coverage t…
Mec-iS Jul 8, 2026
550241e
Update ndarray requirement from 0.15 to 0.17 (#353)
dependabot[bot] Jul 8, 2026
f51248b
Cleanup (#380)
Mec-iS Jul 9, 2026
0bd7464
Fix multiclass macro F1 to average per-class F-scores (#382)
gaoflow Jul 21, 2026
ce68041
fix(f1): review follow-ups from #382 (#383)
Mec-iS Jul 21, 2026
a7f3b5d
refactor(metrics): share per-class confusion counts across Precision/…
Mec-iS Jul 21, 2026
491b16f
feat: add DenseMatrix ndarray constructor (#381)
oiahoon Jul 21, 2026
8d8374e
Update README.md
Mec-iS Jul 21, 2026
7118db8
perf(ensemble): pre-allocate tree and sample vector capacities in for…
Aditya-9-6 Jul 24, 2026
f25a7aa
Merge branch 'main' of github.com:smartcorelib/smartcore into develop…
Mec-iS Jul 28, 2026
3fecb74
bump version
Mec-iS Jul 28, 2026
707f7f6
Merge branch 'development' of github.com:smartcorelib/smartcore into …
Mec-iS Jul 28, 2026
3febb4c
bump to v0.5.5
Mec-iS Jul 28, 2026
ecc3720
docs: document Cargo.toml features (#387)
teddytennant Aug 7, 2026
9370c18
perf(tree): avoid allocation during row prediction (#389)
SunnyWar Aug 8, 2026
44510dd
test: replace unmaintained bincode with postcard (#390)
seroze Aug 9, 2026
bd67910
ci(coverage): include doctests + strict --fail-under 44 gate (Stage 0…
Mec-iS Aug 9, 2026
f7398c7
test(stage-1): fill untested modules + revive serde tests (#392) (#405)
Mec-iS Aug 9, 2026
b9cc0aa
Create FUNDING.yml
Mec-iS Aug 9, 2026
ed49b31
chore(edition): port to Rust 2024 + declare MSRV 1.85 (#401) (#406)
Mec-iS Aug 9, 2026
24c21ac
refactor(matrix): replace unsafe raw-pointer iterator_mut with safe s…
Mec-iS Aug 9, 2026
80cf979
ci: run smartcore-benches against release commit (#407) (#409)
Mec-iS Aug 9, 2026
4c7d6fa
test(stage-2): add proptest + linalg edge cases (#393) (#410)
Mec-iS Aug 9, 2026
2fa1482
fix(ci): checkout smartcore-benches outside smartcore tree to avoid w…
Mec-iS Aug 9, 2026
608f774
Update README.md
Mec-iS Aug 9, 2026
96fdcee
Update Cargo.toml
Mec-iS Aug 9, 2026
e405156
Update README.md
Mec-iS Aug 9, 2026
6bd1afe
refactor(naive_bayes): remove duplicated RealNumber trait bound (#423)
seroze Aug 10, 2026
5df483d
fix(tests): stage 3 edge-case & parity tests for all modules + bump 0…
Mec-iS Aug 10, 2026
d49f335
fix(tests): stage 4 metrics & distance coverage tests (#395) (#426)
Mec-iS Aug 10, 2026
574f0f2
add instruction
Mec-iS Aug 10, 2026
172f0f5
fix(tests): stage 5 feature-gated & cross-cutting tests (#396) (#427)
Mec-iS Aug 10, 2026
4b9652d
Merge branch 'development' of github.com:smartcorelib/smartcore into …
Mec-iS Aug 10, 2026
63409a3
fix release bench pipeline
Mec-iS Aug 10, 2026
d8d7383
fix(tests): Stage 6 integration tests + bump patch 0.6.5 → 0.6.6 (#39…
Mec-iS Aug 10, 2026
0440ef3
chore(#398): remove dead svm/search module
Mec-iS Aug 10, 2026
d96a406
chore(#398): remove dead svm/search/svc_params
Mec-iS Aug 10, 2026
f9b7b06
chore(#398): remove dead svm/search/svr_params
Mec-iS Aug 10, 2026
4b5a699
chore(#398): remove dead model_selection/hyper_tuning module
Mec-iS Aug 10, 2026
513a1c0
chore(#398): remove dead model_selection/hyper_tuning/grid_search
Mec-iS Aug 10, 2026
68e51cf
chore(#398): remove dead mod declarations from svm and model_selection
Mec-iS Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $ rust-code-analysis-cli -p src/algorithm/neighbour/fastpair.rs --ls 22 --le 213

1. After a PR is opened maintainers are notified
2. Probably changes will be required to comply with the workflow, these commands are run automatically and all tests shall pass:
* **Formatting**: run `rustfmt src/*.rs` to apply automatic formatting
* **Formatting**: run `cargo fmt --all -- --check` to apply automatic formatting
* **Linting**: `clippy` is used with command `cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings`
* **Coverage** (optional): `tarpaulin` is used with command `cargo tarpaulin --out Lcov --all-features -- --test-threads 1`
* **Testing**: multiple test pipelines are run for different targets
Expand Down
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [Mec-iS, tuned-org-uk]
custom: ['https://tuned.org.uk']
34 changes: 29 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
{ os: "ubuntu", target: "wasm32-unknown-unknown" },
{ os: "macos", target: "aarch64-apple-darwin" },
]
env:
TZ: "/usr/share/zoneinfo/your/location"
steps:
- uses: actions/checkout@v4
- name: Cache .cargo and target
Expand Down Expand Up @@ -55,9 +53,11 @@ jobs:
strategy:
matrix:
platform: [{ os: "ubuntu" }]
features: ["--features serde", "--features datasets", ""]
env:
TZ: "/usr/share/zoneinfo/your/location"
features:
- "--features serde"
- "--features datasets"
- "--features ndarray-bindings"
- ""
steps:
- uses: actions/checkout@v4
- name: Cache .cargo and target
Expand All @@ -72,3 +72,27 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Stable Build
run: cargo build --no-default-features ${{ matrix.features }}
- name: Tests
if: matrix.features == '--features ndarray-bindings'
run: cargo test --no-default-features ${{ matrix.features }}

msrv:
# Verify the declared rust-version (MSRV) in Cargo.toml still builds.
name: MSRV (1.85)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache .cargo and target
uses: actions/cache@v4
with:
path: |
~/.cargo
./target
key: ${{ runner.os }}-msrv-${{ hashFiles('Cargo.toml') }}
restore-keys: ${{ runner.os }}-msrv
- name: Install Rust 1.85
uses: dtolnay/rust-toolchain@1.85.0
- name: Build with all features at MSRV
run: cargo +1.85.0 build --all-features
- name: Build without features at MSRV
run: cargo +1.85.0 build
5 changes: 3 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
run: cargo install --locked cargo-tarpaulin
- name: Run cargo-tarpaulin
run: cargo tarpaulin --out Lcov --all-features -- --test-threads 1
run: cargo tarpaulin --all-features --run-types Tests --run-types Doctests --out Lcov --fail-under 44 -- --test-threads 1
- name: Upload to codecov.io
if: always()
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
71 changes: 71 additions & 0 deletions .github/workflows/release-bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release benchmarks

# When a release is published, clone smartcore-benches into a sibling
# directory and run its criterion + iai-callgrind harness against the
# released smartcore code. A `[patch.crates-io]` override repoints the
# benches' `smartcore = "0.6"` dependency to the local checkout, so no
# crates.io round-trip is needed. The benches repo is checked out OUTSIDE
# the smartcore tree to avoid Cargo's workspace auto-detection picking up
# smartcore's [workspace] table and treating benches as a member.
# See https://github.com/smartcorelib/smartcore/issues/407

on:
release:
types: [published]

jobs:
bench:
runs-on: ubuntu-latest
steps:
- name: Checkout smartcore (release commit)
uses: actions/checkout@v4

- name: Checkout smartcore-benches (sibling directory, outside smartcore tree)
run: git clone --depth=1 https://github.com/smartcorelib/smartcore-benches.git ../smartcore-benches

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install Valgrind (for iai-callgrind)
run: sudo apt-get update && sudo apt-get install -y valgrind

- name: Cache .cargo and target
uses: actions/cache@v4
with:
path: |
~/.cargo
../smartcore-benches/target
key: release-bench-${{ hashFiles('Cargo.toml', '../smartcore-benches/Cargo.toml') }}
restore-keys: release-bench-

- name: Patch benches to use local smartcore
run: |
mkdir -p ../smartcore-benches/.cargo
cat > ../smartcore-benches/.cargo/config.toml <<'CFG'
[patch.crates-io]
smartcore = { path = "../smartcore" }
CFG

- name: Build benches (no-run)
working-directory: ../smartcore-benches
run: cargo bench --no-run

- name: Run criterion benchmarks
working-directory: ../smartcore-benches
run: |
mkdir -p bench-output
cargo bench -- --output-format bencher | tee bench-output/criterion.json

- name: Run iai-callgrind benchmarks
working-directory: ../smartcore-benches
run: |
for bench in iai_matmul iai_ab iai_svd iai_cover_tree iai_iterator_mut; do
cargo bench --bench "$bench" -- --save-baseline=release 2>&1 | tee "bench-output/${bench}.json" || true
done

- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: release-benchmark-results
path: ../smartcore-benches/bench-output/
retention-days: 90
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Generated by Cargo
# will have compiled files and executables
/target/
.opencode
opencode.json

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down Expand Up @@ -28,4 +30,10 @@ out.svg
FlameGraph/
out.stacks
*.json
*.txt
*.txt

# coverage artifacts (cargo-tarpaulin / LLVM instrumentation)
*.profraw
lcov.info
cobertura.xml
tarpaulin-report.*
129 changes: 129 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# AGENTS.md

Agent-focused guidance for working on the `smartcore` Rust machine-learning library.

## Project basics

- **Language / edition**: Rust 2024 (MSRV 1.85 — verified by the `msrv` CI job).
- **Repository**: https://github.com/smartcorelib/smartcore
- **Default branch**: `development`. All changes should target `development` first.
- **License**: Apache-2.0.
- **Authors**: "smartcore Developers".

Always use ASD-STE100 Simplified Technical English

## Build and test

Common commands used in this codebase:

```bash
# Build default (no features)
cargo build

# Build with optional ndarray support
cargo build --features ndarray-bindings

# Build everything
cargo build --all-features

# Run tests
cargo test
cargo test --features ndarray-bindings
cargo test --all-features

# Formatting (enforced in CI)
cargo fmt --all -- --check

# Linting (enforced in CI)
cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings

# Generate and review docs
cargo doc --no-deps --open
```

## Cargo features

Key features defined in `Cargo.toml`:

- `ndarray-bindings` — optional `ndarray` integration.
- `serde` — serialization support (also pulls in `typetag`).
- `datasets` — built-in sample datasets; implies `std_rand` and `serde`.
- `std_rand` — enables standard RNG facilities in `rand`.
- `js` — for `wasm32-unknown-unknown` in-browser usage.

When touching feature-gated code, run at least `cargo build --all-features` and `cargo test --all-features`.

## Code conventions

- Follow the existing **sklearn-inspired API** where possible for a frictionless user experience.
- Keep the library code **pure Rust**. Unsafe code is strongly discouraged; limited low-level exceptions are allowed only with clear justification.
- **Do not use macros in library code**. Prefer explicit, readable implementations.
- Target small/average datasets with a limited memory footprint rather than big-data optimizations.
- Every public module should:
- Start with a `//!` doc comment that includes references to scientific literature relating the code to research.
- Provide Rust **doctests** that demonstrate usage.
- Provide comprehensive unit tests in a `mod tests {}` submodule at the end of the file.
- IO-related code should prefer abstractions that make non-IO testing straightforward (see `readers/iotesting`).
- Dataset serialization helpers should be gated so they do not trigger unintended file writes on wasm targets.

## Pull request workflow

- Open an issue describing the change before starting significant work.
- Search open and closed issues/PRs for related discussion.
- Open PRs against the `development` branch.
- Use the PR template (`.github/PULL_REQUEST_TEMPLATE.md`) and erase sections that do not apply.
- Update `CHANGELOG.md` for breaking changes, new environment variables, exposed ports, useful file locations, and container parameters.
- Ensure CI checks pass:
- `cargo fmt --all -- --check`
- `cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings`
- Full test suite on relevant targets
- A PR requires sign-off from at least one other developer before merging.

## Code structure

High-level layout:

- `src/numbers/` — foundational numeric traits built on `num-traits`.
- `src/linalg/basic/` — core linear-algebra traits:
- `arrays` — `Array`, `Array1`, `Array2`, view traits (`ArrayView*`, `MutArrayView*`).
- `matrix` — `DenseMatrix`, the main instantiable matrix type.
- `vector` — convenience implementations for `std::Vec`.
- `src/linalg/traits/` — theoretical linear-algebra capability traits (`QRDecomposable`, `SVDDecomposable`, `CholeskyDecomposable`, etc.).
- `src/metrics/` — classification, regression, clustering metrics and distance measures.
- `src/linear/`, `src/tree/`, `src/ensemble/`, `src/svm/`, `src/neighbors/`, `src/naive_bayes/`, `src/clustering/`, `src/decomposition/`, `src/preprocessing/` — algorithm modules.
- `src/model_selection/` — cross-validation, search parameters.
- `src/readers/` — CSV and dataset readers.

Most algorithm code is generic over the `numbers` and `linalg` traits rather than concrete types.

## Edition 2024 invariants

The crate was ported from edition 2021 to edition 2024 (#401). The port relies on the following invariants — when touching this code, keep them intact so the edition-2024 lint group (`rust-2024-compatibility`) stays clean:

- **No return-position `impl Trait` (RPIT)**. The codebase returns zero `-> impl Trait` items today. Introducing one would opt into the 2024 lifetime over-capture rules; gate any new RPIT with an explicit lifetime bound and re-run `cargo clippy --all-features -- -Drust-2024-compatibility` before landing.
- **`dyn Trait` bounds carry explicit lifetimes**. All `Box<dyn Trait>` returns are written as `Box<dyn Trait + 'a>` (see `linalg/basic/arrays.rs` and `vector.rs` iterators/views). Do not drop the `+ 'a`; edition 2024 changes the default elision and a bare `dyn Trait` may not mean what you intend.
- **Tail-expression drop order matters**. Edition 2024 reorders temporaries in tail position. When a tail expression owns a temporary that a borrow extends through (e.g. `(self.sub(other)).iterator(0).all(...)`), bind the owned intermediate to a local first:
```rust
// 2024-safe form
let diff = self.sub(other);
diff.iterator(0).all(|v| v.abs() <= error)
```
A regression here triggers `tail_expr_drop_order` warnings under `rust-2024-compatibility`.
- **Lint suppressions use `#[expect(...)]` where the lint actually fires, `#[allow(...)]` otherwise**. The crate migrated `#[allow]` → `#[expect]` where clippy confirmed the lint still fires under `--all-features`; sites where the lint does *not* fire (e.g. some `clippy::ptr_arg`/`upper_case_acronyms`/`dead_code` suppressions) remain `#[allow]` to avoid `unfulfilled_lint_expectations` errors. `#[expect]` errors if its lint later stops firing — prefer it for new suppressions where you've verified the lint fires; fall back to `#[allow]` when a lint genuinely doesn't fire and you still want to document intent. Re-run `cargo clippy --all-features -- -Drust-2018-idioms -Drust-2024-compatibility -Dwarnings` before landing.
- **No `unsafe` in library code**. The four remaining `unsafe {}` blocks in `linalg/basic/matrix.rs` (`iterator_mut` raw-pointer traversal for `DenseMatrixMutView`) are tracked by #368 and slated for a safe `split_at_mut` rewrite in a dedicated PR. Until that lands, do not add new `unsafe`; any new `unsafe` requires clear justification and must not trigger `unsafe_op_in_unsafe_fn` (default-warn in 2024) or other unsafe-attr lints.
- **Preserve the bespoke numerical-system logic and performance.** The numeric/linalg traits and their concrete impls (`numbers/`, `linalg/basic/arrays.rs`, `linalg/basic/matrix.rs`, the `HighOrderOperations`/`matmul`/`iterator` paths) are hand-tuned for correctness and speed. When refactoring (e.g. for edition-2024 tail-expr drop order, for #368 `unsafe` removal, or for any other non-behavioral change), **keep the numerical logic intact and do not regress performance**: change only the structural form (bind intermediates, swap the unsafe mechanism), never the math, indexing scheme, traversal order, or allocation strategy. Verify a refactor is behavior-preserving by re-running `cargo test --all-features` (known-answer tests must still pass) before landing.
- **Coverage cfg is not referenced in source**. We never `cfg(coverage)` or `cfg(tarpaulin)` in `src/`, so the 2024 `unexpected_cfgs` lint stays silent. If you add such a cfg, declare it in the `Cargo.toml` `[lints.rust]` `check-cfg` table to avoid the warning.

### Commands for edition-2024 health

```bash
# The rust-2018-idioms gate is still enforced; add the 2024 group locally:
cargo clippy --all-features -- -Drust-2018-idioms -Drust-2024-compatibility -Dwarnings

# MSRV check (mirrors the msrv CI job):
cargo +1.85.0 build --all-features
```

## Conduct

This project follows the [Contributor Covenant Code of Conduct](.github/CODE_OF_CONDUCT.md). Interactions should be respectful and harassment-free.
Loading
Loading