Avoid repeated resolver prefetches - #20465
Closed
charliermarsh wants to merge 1 commit into
Closed
Conversation
charliermarsh
force-pushed
the
charlie/codex-prefetch-once
branch
from
July 16, 2026 03:16
832372e to
5a248cc
Compare
charliermarsh
temporarily deployed
to
automations
July 16, 2026 04:37 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unit propagation repeatedly tightens ranges for packages that were already speculatively prefetched. Selecting a candidate for every new range is relatively expensive even when the likely distribution metadata is already in memory. This prefetches each package once per fork and leaves eventual candidate selection/fetching unchanged.
This is deliberately experimental: avoiding later speculative requests can trade away some cold-cache overlap on backtracking-heavy resolutions.
Performance
Measured with profiling binaries, a warm local cache,
--offline, pinned CPUs (8-15), fixedUV_EXCLUDE_NEWER, alternating base/head order, 10 warmups, and 60 paired runs. This is incremental on currentmain(including #20461) plus #20450, marker fastpaths, and cache-payload offload. Every pair produced identical lockfile hashes.Transformers is the meaningful CPU win: block-aware paired analysis was -2.51% CPU (95% CI -3.51 to -1.47), with neutral wall time. A resolver trace confirms candidate selections drop from 4,647 to 3,572 (-23.1%) for the same resulting lock.
The focused resolver suite passes (63 tests); formatting and diff checks are clean.