Skip to content

shards: simplify branch repository shard selection - #1136

Merged
keegancsmith merged 1 commit into
mainfrom
k/simplify-branches-repos-selector
Aug 14, 2026
Merged

shards: simplify branch repository shard selection#1136
keegancsmith merged 1 commit into
mainfrom
k/simplify-branches-repos-selector

Conversation

@keegancsmith

@keegancsmith keegancsmith commented Aug 14, 2026

Copy link
Copy Markdown
Member

This follows #1127 by consolidating branch repository shard selection around observed misses. It removes the duplicated preflight scans, first-match sampling, and special saturated-query policy paths, reducing production code by 159 net lines while preserving the selection behavior introduced there.

In simplifying the code we regress on some microbenchmarks, but the absolute value is less than a microsecond. For the larger benchmarks we actually have an improvement of 3-6%.

Consolidate adaptive selection around observed misses to remove duplicated
preflight and saturated-query policies while preserving representative
performance.

Amp-Thread-ID: https://ampcode.com/threads/T-019fff6c-4f91-7019-8e25-c855421914f0
Co-authored-by: Amp <amp@ampcode.com>
@keegancsmith keegancsmith changed the title Simplify branch repository shard selection shards: simplify branch repository shard selection Aug 14, 2026
@keegancsmith
keegancsmith marked this pull request as ready for review August 14, 2026 09:32
@keegancsmith

Copy link
Copy Markdown
Member Author

@burmudar @eseliger I don't expect a deep review here. This PR was motivated by the somewhat large perfloop PR #1127 that I just landed which added lots of code. Instead of going back and forth on that PR to simplify the code I ended up just landing it and creating this PR. cc @tsenart

@keegancsmith
keegancsmith merged commit 4322d49 into main Aug 14, 2026
7 checks passed
@keegancsmith
keegancsmith deleted the k/simplify-branches-repos-selector branch August 14, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants