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

Add more SAT resolver tests #14614

Merged
merged 4 commits into from
Oct 8, 2024
Merged

Conversation

x-hgg-x
Copy link
Contributor

@x-hgg-x x-hgg-x commented Sep 29, 2024

What does this PR try to resolve?

This is a follow-up of #14583.

How should we test and review this PR?

  • Commit 1 splits tests into smaller modules.
  • Commit 2 adds more helper trait methods.
  • Commit 3 refactors computation of the SAT clauses, by introducing intermediate boolean variables for each dependency and each dependency feature declared in a package.
    The old behavior was incorrect: package features specified in an optional dependency were activated if the package was activated, even if the dependency wasn't activated.
  • Commit 4 add tests from https://github.com/Eh2406/pubgrub-crates-benchmark/tree/main/out/index_ron.

r? Eh2406

@rustbot rustbot added A-dependency-resolution Area: dependency resolution and the resolver S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 29, 2024
@Eh2406
Copy link
Contributor

Eh2406 commented Sep 30, 2024

First off, thank you so much for splitting the PR into independently understandable commits. It makes reviewing this PR much more feasible. For example the first 2 commits look 100% and ready for +1. If the other commits require extensive discussion, maybe we should get those first two merged asap.

Secondly, thank you for giving descriptive names to the pubgrub tests! Would you mind if I took your good names back to that project? (Or even better do you want to do a PR?)

@x-hgg-x x-hgg-x force-pushed the more-sat-resolver-tests branch 6 times, most recently from e92e958 to fddd9cb Compare October 1, 2024 18:35
@x-hgg-x
Copy link
Contributor Author

x-hgg-x commented Oct 1, 2024

Would you mind if I took your good names back to that project? (Or even better do you want to do a PR?)

I posted a PR: Eh2406/pubgrub-crates-benchmark#10.

@Eh2406
Copy link
Contributor

Eh2406 commented Oct 1, 2024

I meant to do a new round of review today, looking at your new changes and being sure your old changes still made sense with fresh eyes and making sure the tests had translated correctly. (If I had to do the translations I would've made more than a few copy/paste errors.) Unfortunately, had a family emergency come up overnight. Luckily, everyone's okay. The only casualty was my sleep/concentration schedule. With the holy days the end of this week, I cannot guarantee availability of review time. I will make time for this Monday, if I have not gotten to it sooner. Given how enthusiastic I am to see your progress on this work, I am very sorry at how I'm slowing you down.

@Eh2406
Copy link
Contributor

Eh2406 commented Oct 8, 2024

SAT is slippery, I wouldn't be surprised if we find more weird cases as we add more test cases/fuzzing. But I don't know what they are. So for now this looks good. Thank you!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 8, 2024

📌 Commit 480e8fc has been approved by Eh2406

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 8, 2024
bors added a commit that referenced this pull request Oct 8, 2024
Add more SAT resolver tests

### What does this PR try to resolve?

This is a follow-up of #14583.

### How should we test and review this PR?

* Commit 1 splits tests into smaller modules.
* Commit 2 adds more helper trait methods.
* Commit 3 refactors computation of the SAT clauses, by introducing intermediate boolean variables for each dependency and each dependency feature declared in a package.
The old behavior was incorrect: package features specified in an optional dependency were activated if the package was activated, even if the dependency wasn't activated.
* Commit 4 add tests from https://github.com/Eh2406/pubgrub-crates-benchmark/tree/main/out/index_ron.

r? Eh2406
@bors
Copy link
Contributor

bors commented Oct 8, 2024

⌛ Testing commit 480e8fc with merge 65a883c...

@bors
Copy link
Contributor

bors commented Oct 8, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 8, 2024
@x-hgg-x x-hgg-x force-pushed the more-sat-resolver-tests branch from 480e8fc to d1ef31c Compare October 8, 2024 05:56
@x-hgg-x
Copy link
Contributor Author

x-hgg-x commented Oct 8, 2024

The lockfile and msrv test in the CI are failing, since the lockfile has changed.

Add new intermediate boolean variables for each dependency and each dependency feature declared in a package.
This is used to simplify computation of the sat clauses.

Add support for multiple dependencies with the same name, if their kind or target is different.

A non-weak dependency feature for an optional dependency now activates a feature of the same name in the sat resolver.
@x-hgg-x x-hgg-x force-pushed the more-sat-resolver-tests branch from d1ef31c to dedf251 Compare October 8, 2024 06:06
@x-hgg-x
Copy link
Contributor Author

x-hgg-x commented Oct 8, 2024

It should be good now after a rebase on master.

@Eh2406
Copy link
Contributor

Eh2406 commented Oct 8, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Oct 8, 2024

📌 Commit dedf251 has been approved by Eh2406

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 8, 2024
@bors
Copy link
Contributor

bors commented Oct 8, 2024

⌛ Testing commit dedf251 with merge aea3404...

@bors
Copy link
Contributor

bors commented Oct 8, 2024

☀️ Test successful - checks-actions
Approved by: Eh2406
Pushing aea3404 to master...

@bors bors merged commit aea3404 into rust-lang:master Oct 8, 2024
24 checks passed
@x-hgg-x x-hgg-x deleted the more-sat-resolver-tests branch October 8, 2024 16:35
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 9, 2024
Update cargo

8 commits in ad074abe3a18ce8444c06f962ceecfd056acfc73..15fbd2f607d4defc87053b8b76bf5038f2483cf4
2024-10-04 18:18:15 +0000 to 2024-10-08 21:08:11 +0000
- initial version of checksum based freshness (rust-lang/cargo#14137)
- feat: Add custom completer for completing registry name (rust-lang/cargo#14656)
- Document build-plan as being deprecated (rust-lang/cargo#14657)
- fix(complete): Don't complete files for any value (rust-lang/cargo#14653)
- Add more SAT resolver tests (rust-lang/cargo#14614)
- fix: avoid inserting duplicate `dylib_path_envvar` when calling `cargo run` recursively (rust-lang/cargo#14464)
- chore(deps): bump gix-path from 0.10.9 to 0.10.11 (rust-lang/cargo#14489)
- improve error reporting when feature not found in `activated_features` (rust-lang/cargo#14647)

---

This also adds three license exceptions to Cargo.

* arrayref — BSD-2-Clause
* blake3 — CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception
* constant_time_eq — CC0-1.0 OR MIT-0 OR Apache-2.0

These exceptions were added to rustc in rust-lang#126930, so should be fine for Cargo as well.
@rustbot rustbot added this to the 1.83.0 milestone Oct 9, 2024
bors added a commit that referenced this pull request Oct 22, 2024
test: add fixes in the sat resolver

### What does this PR try to resolve?

This is a follow-up of #14614.

### How should we test and review this PR?

Commit 1 removes duplicate variables in the sat resolver.
Commit 2 removes useless clones in the sat resolver.

r? Eh2406
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependency-resolution Area: dependency resolution and the resolver S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants