-
Notifications
You must be signed in to change notification settings - Fork 196
Open
Labels
Description
Lazy Tagged Versions Mechanism
The Problem
Right now we have this global maxTaggedVersions that nukes all package caches when it changes.
Instead of fetching everything upfront, we can do a fallback thing where we only grab more versions when the SAT solver actually gets stuck.
The basic idea:
- Track attempts per package: Each package keeps track of how many tagged versions it's actually tried to fetch
- Start small, grow exponentially: Begin with just 1 version, then 2, 4, 8, 16... until we hit the max. Most packages probably won't need more than a few versions anyway.
- Reuse what we have: If we previously fetched 10 versions for a package and now we're doing a level-2 attempt, just use what's already there. No point re-fetching.
- Be smart about failures:
- If there's an immediate contradiction → just fail, don't waste time
- If we run out of options → try the next level with more versions
Pros
- Most packages will probably solve with just a few versions
- We keep the cache data around instead of throwing it away
- It scales automatically based on how complex the dependencies are
How It'd Work
The solver would basically retry in rounds
Turns the whole "fetch everything first" approach into "fetch what you need when you need it"
This feature would require to be implemented first:
- Bootstrap Nim
- Atomic Parser Fallback (rather than current sat pass fallback)
- Optional: retrieve the cache from disk instead of from the json file (reduces complexity)
Araq