-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 readme to resolver-tests crate #13319
Comments
The SAT resolver is a re-implementation of our resolver for us to compare results against like with cargo/crates/resolver-tests/src/lib.rs Line 34 in e01eeb0
which is used in tests like cargo/crates/resolver-tests/src/lib.rs Line 34 in e01eeb0
I'm not one to be able to speak to those kind of details but the fact that the two resolvers match behavior means we've modeled it in SAT in a way that works. |
@epage has summarize things pretty well, although he's pasted the same link twice. I am happy to answer any follow-up question you may have! The challenge will be getting me to stop talking. If you have specific questions feel free to ask them here, or come to my office hours. I would appreciate if you could turn your new understanding into documentation. @ShuiRuTian, when you are surprised to see this code, which documentation did you look at? Were there places you looked where there wasn't documentation? Were there confusing things about the documentation you did find? Let's make (or move) answers to your questions, and put them where you would have found them! |
@Eh2406 Hi. I read the comments in the file and some third-party documents:
NOTE: here is some more docs, but not as important as the above ones
And I found most of SAT resolvers work for the environment that does not allow duplicated packages(.i.e, you could not have a package with different versions). It feels like reasonable, if you could download different versions, SAT should be able to always give an answer, then it does not make much of sense to use SAT. Finally, when I read the resolver of cargo, I wanted to have a look at test files firstly, then I am surprised to find cargo has a SAT resolver only for test. Especially the comment says "The SAT library dose not optimize for the newer version, so the selected packages may not match the real resolver." Thanks for the following up! |
Looking around, you make a good point. We don't seem to have general documentation about what the
If you enjoyed this link, you may also be interested in the https://github.com/pubgrub-rs/pubgrub project and its longform documentation at https://pubgrub-rs-guide.netlify.app/ we would love help.
In order to always be able to find a solution you either need to not have "these two versions are not compatible" rules (like npm) or not have "these two version constraints do not overlap" (like go). Otherwise you're resolver should be NP-complete and a SAT library might be useful. SAT is a remarkably general framework. It consists of variables and clauses. If there is a solution each variable must be set to either So how do we model dependency resolution as an SAT problem.
I hope that helps you understand what is going on. Feel free to turn this into comments in the code to help answer questions going forward! And if you have follow-up questions please ask! |
Cooooool, especially about https://pubgrub-rs-guide.netlify.app/. Looks really interesting. Need some time to read the doc/code to figure out how it works. Would like to contribute a README if I am ready in future! |
@epage , what is correct tag for "help wanted" these days? |
S-accepted |
Assumed Eh2406 was going to tag this as |
doc: Add README for resolver-tests ### What does this PR try to resolve? This collect the comments from `@Eh2406` about the resolver-tests and add a README to it. ### How should we test and review this PR? ### Additional information Maybe Fixed #13319 See #11938 (comment)
doc: Add README for resolver-tests ### What does this PR try to resolve? This collect the comments from `@Eh2406` about the resolver-tests and add a README to it. ### How should we test and review this PR? ### Additional information Maybe Fixed #13319 See #11938 (comment)
Problem
It's surprised for me to find there is a SAT resolver in resolver-tests crate.
It looks strange,
So, it feels like it's useless? What is the purpose of this resolver? Another strategy which might be enabled in the future?
Steps
No response
Possible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: