Skip to content

Lazy Tagged Versions Mechanism #1478

@jmgomez

Description

@jmgomez

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:

  1. Track attempts per package: Each package keeps track of how many tagged versions it's actually tried to fetch
  2. 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.
  3. 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.
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions