Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from rulinalg to nalgebra for SVD #417

Merged
merged 11 commits into from
Oct 3, 2021

Conversation

Palladinium
Copy link
Contributor

@Palladinium Palladinium commented Jun 2, 2020

Fixes #412

This is working fine on a private project, but I don't know much about linear algebra and there aren't nearly enough test cases to ensure this doesn't break a bunch of stuff, so someone who's more knowledgeable should double check this.

@Palladinium Palladinium changed the title Switch from rulinalg to nalgebra for SVD WIP: Switch from rulinalg to nalgebra for SVD Jun 2, 2020
@Palladinium Palladinium changed the title WIP: Switch from rulinalg to nalgebra for SVD Switch from rulinalg to nalgebra for SVD Jun 2, 2020
arcdarcd added a commit to arcdarcd/noaa-apt that referenced this pull request Aug 25, 2020
After running `cargo audit`, it turns out `imageproc` crate has a known vulnerability:
https://rustsec.org/advisories/RUSTSEC-2020-0023

Also, we're no longer using anything from this crate.
If we need something in the future, keep an eye on this pull request that
seems to solve the issue by swapping the vulnerable dependency in imageproc
with another crate:
image-rs/imageproc#417

Details:

```
$cargo audit

error: Vulnerable crates found!

ID:       RUSTSEC-2020-0023
Crate:    rulinalg
Version:  0.4.2
Date:     2020-02-11
URL:      https://rustsec.org/advisories/RUSTSEC-2020-0023
Title:    Lifetime boundary for `raw_slice` and `raw_slice_mut` are incorrect
Solution:  No safe upgrade is available!
Dependency tree:
rulinalg 0.4.2
└── imageproc 0.21.0
    └── noaa-apt 1.2.0
```
martinber pushed a commit to martinber/noaa-apt that referenced this pull request Sep 17, 2020
After running `cargo audit`, it turns out `imageproc` crate has a known vulnerability:
https://rustsec.org/advisories/RUSTSEC-2020-0023

Also, we're no longer using anything from this crate.
If we need something in the future, keep an eye on this pull request that
seems to solve the issue by swapping the vulnerable dependency in imageproc
with another crate:
image-rs/imageproc#417

Details:

```
$cargo audit

error: Vulnerable crates found!

ID:       RUSTSEC-2020-0023
Crate:    rulinalg
Version:  0.4.2
Date:     2020-02-11
URL:      https://rustsec.org/advisories/RUSTSEC-2020-0023
Title:    Lifetime boundary for `raw_slice` and `raw_slice_mut` are incorrect
Solution:  No safe upgrade is available!
Dependency tree:
rulinalg 0.4.2
└── imageproc 0.21.0
    └── noaa-apt 1.2.0
```
@Palladinium
Copy link
Contributor Author

I've been spending some time testing and debugging this branch, as well as reading into the linear algebra behind the logic here, and I'm now pretty reasonably confident I'm doing this right.

It should be safe to merge, but once again it'd be good if someone with a better background in mathematics could double-check this.

@ciuncan
Copy link
Contributor

ciuncan commented Oct 2, 2021

Today I ran cargo audit on our repo and the only dependency with vulnerability was showing up as imageproc due to rulinalg. I am glad that someone worked on replacing rulinalg with nalgebra.

❯ cargo audit
    Fetching advisory database from `https://github.com/RustSec/advisory-db.git`
      Loaded 366 security advisories (from /Users/ceyhun/.cargo/advisory-db)
    Updating crates.io index
    Scanning Cargo.lock for vulnerabilities (356 crate dependencies)
Crate:         rulinalg
Version:       0.4.2
Title:         Lifetime boundary for `raw_slice` and `raw_slice_mut` are incorrect
Date:          2020-02-11
ID:            RUSTSEC-2020-0023
URL:           https://rustsec.org/advisories/RUSTSEC-2020-0023
Solution:      No safe upgrade is available!
Dependency tree: 
rulinalg 0.4.2
└── imageproc 0.22.0
    └── raijin 0.2.0

Crate:         rulinalg
Version:       0.4.2
Warning:       unmaintained
Title:         rulinalg is unmaintained, use nalgebra instead
Date:          2020-02-11
ID:            RUSTSEC-2020-0147
URL:           https://rustsec.org/advisories/RUSTSEC-2020-0147

error: 1 vulnerability found!
warning: 1 allowed warning found
[1]    7589 exit 1     cargo audit

@timbod7
Copy link

timbod7 commented Oct 3, 2021

I've tried out this PR, and it works more reliably the the code it replaces.

@theotherphil theotherphil merged commit 2631ccc into image-rs:master Oct 3, 2021
@theotherphil
Copy link
Contributor

Thanks! Sorry about the very long delay.

@ciuncan
Copy link
Contributor

ciuncan commented Oct 3, 2021

Thank you guys for the very quick test and merge! When can we expect a release including this merge?

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.

getting a Projection by from_control_points makes program freezing
4 participants