Hacker News new | ask | show | jobs
by kolja005 582 days ago
I recently watched a talk by the author of uv that was surprisingly fascinating [1]. He goes into a few of the more notable hacks that they had to come up with to make it as fast as it is. The most interesting thing for me was that package resolution in python given constraints defined (eg. in requirements.txt) maps to a boolean satisfiability problem which is NP-complete. So uv uses a custom SAT solver to do this. I totally under-appreciated how much goes into this software and I'm bummed I have to use Poetry at work after having watched this talk.

[1] https://www.youtube.com/watch?v=gSKTfG1GXYQ

edit: NP-complete not NP-hard

1 comments

I haven’t used Conda since 2021 but recall it had a SAT solver that was very slow especially on degenerate cases.

How does uv’s sat solver compare?

There are such cases in uv as well, and I’ve hit them quite often when I didn’t specify lower bounds (especially for boto3).
In our internal benchmarks miniconda is about as fast as uv at installing torch.