Skip to content

refactor(linalg): drop redundant PartialEq bound from block-sparse test helpers - #462

Merged
ultimatile merged 1 commit into
mainfrom
refactor/461-drop-partialeq-bound
Jul 12, 2026
Merged

refactor(linalg): drop redundant PartialEq bound from block-sparse test helpers#462
ultimatile merged 1 commit into
mainfrom
refactor/461-drop-partialeq-bound

Conversation

@ultimatile

@ultimatile ultimatile commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Sector is declared pub trait Sector: Clone + Eq + Ord + Hash + Debug, and Rust std declares Eq: PartialEq<Self>, so any S: Sector already entails S: PartialEq. The S: Sector + PartialEq bounds on the block-sparse test helpers therefore read as if PartialEq were an extra requirement beyond Sector, which it is not. This consolidates them on S: Sector, a semantic no-op that keeps the helper signatures honest about what they require.

Closes #461

Changes

Replace S: Sector + PartialEq with S: Sector at all seven block-sparse test helpers:

  • block_sparse_decomp/tests/mod.rsverify_svd_reconstruction, verify_two_factor_reconstruction, assert_orthonormal_columns, assert_orthonormal_rows
  • block_sparse_decomp/eigh/tests.rsverify_reconstruction
  • block_sparse_decomp/eig/tests.rsverify_reconstruction
  • block_sparse_expm/tests.rs — the verify_expm where-clause bound

Test plan

  • cargo test -p ariadnetor-linalg: 491 passed, 0 failed.
  • cargo make clippy (denies warnings, covers all test targets): clean.
  • Grep clean: no Sector + PartialEq bound remains in ariadnetor-linalg.

Summary by CodeRabbit

  • Tests
    • Generalized block-sparse linear algebra test utilities to support sector types without requiring equality comparison.
    • Existing reconstruction, orthonormality, eigenpair, and matrix exponential test behavior remains unchanged.

…st helpers

`Sector` already requires `Eq` as a supertrait, and `Eq: PartialEq`, so
`S: Sector + PartialEq` is exactly equivalent to `S: Sector`. Consolidate on
`S: Sector` across the block-sparse test helpers so the signatures stop
implying `PartialEq` is an extra requirement beyond `Sector`.

Closes #461
@ultimatile
ultimatile requested a review from Copilot July 12, 2026 13:17
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 819599cd-ed15-4fb0-bd6c-e8222d00508b

📥 Commits

Reviewing files that changed from the base of the PR and between b7cd7b2 and 5d3c527.

📒 Files selected for processing (4)
  • crates/ariadnetor-linalg/src/block_sparse_decomp/eig/tests.rs
  • crates/ariadnetor-linalg/src/block_sparse_decomp/eigh/tests.rs
  • crates/ariadnetor-linalg/src/block_sparse_decomp/tests/mod.rs
  • crates/ariadnetor-linalg/src/block_sparse_expm/tests.rs

📝 Walkthrough

Walkthrough

Test helpers in block-sparse linear algebra modules now require only the Sector trait instead of redundantly specifying PartialEq. Reconstruction and assertion behavior remains unchanged.

Changes

Sector bound refactor

Layer / File(s) Summary
Generalize block-sparse test helpers
crates/ariadnetor-linalg/src/block_sparse_decomp/tests/mod.rs, crates/ariadnetor-linalg/src/block_sparse_decomp/{eig,eigh}/tests.rs, crates/ariadnetor-linalg/src/block_sparse_expm/tests.rs
Seven test helper signatures remove the redundant PartialEq bound while preserving all existing logic and assertions.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Poem

A bunny trims a bound away,
Sector now leads the way.
Tests still hop and proofs still sing,
No logic changed in anything.
Squeak! Clean traits for spring.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main change: removing redundant PartialEq bounds from block-sparse test helpers.
Linked Issues check ✅ Passed The changes match issue #461 by removing all seven specified S: Sector + PartialEq bounds and preserving test-only behavior.
Out of Scope Changes check ✅ Passed The PR is scoped to the requested bound cleanup in test helpers and does not introduce unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/461-drop-partialeq-bound

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors ariadnetor-linalg’s block-sparse test helpers to remove a redundant + PartialEq bound on S where S: Sector already implies PartialEq (via Eq).

Changes:

  • Replaced S: Sector + PartialEq with S: Sector in the block-sparse decomposition test helpers.
  • Replaced S: Sector + PartialEq with S: Sector in the eigh/eig reconstruction helper tests.
  • Replaced S: Sector + PartialEq with S: Sector in the block-sparse expm test helper (verify_expm) where-clause.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
crates/ariadnetor-linalg/src/block_sparse_expm/tests.rs Drops redundant PartialEq bound from verify_expm helper.
crates/ariadnetor-linalg/src/block_sparse_decomp/tests/mod.rs Drops redundant PartialEq bound from multiple reconstruction/orthonormality helpers.
crates/ariadnetor-linalg/src/block_sparse_decomp/eigh/tests.rs Drops redundant PartialEq bound from verify_reconstruction helper.
crates/ariadnetor-linalg/src/block_sparse_decomp/eig/tests.rs Drops redundant PartialEq bound from verify_reconstruction helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ultimatile
ultimatile merged commit 4ea9557 into main Jul 12, 2026
2 checks passed
@ultimatile
ultimatile deleted the refactor/461-drop-partialeq-bound branch July 12, 2026 13:33
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.

refactor(linalg): drop redundant PartialEq bound from block-sparse test helpers

2 participants