feat: offer a PC first the jobs whose base it already has #105

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:feat/base-affinity into main 2026-11-19 20:14:38 +00:00
Owner

A PC builds main again for most jobs: 144 of 183 in the last 14 days (about 13 minutes each warm, 65 cold), since a job's base is its PR's merge base. 100 of those 144 builds were of a base another PC had already built, so sending each job where its base already is saves most of them. (Building main's head ahead of time would not: only 27 of the 144 were for the head; the median was 9 commits, 5 hours, behind.)

What changed

  • Agent: the capabilities carry bases, the commits whose default base the PC holds whole (the active one, then the kept ones by last use, at most 8; Workspace.BasesHeld, read only). They are sent again after each job, as any change to the capabilities.
  • Coordinator: check_caps takes bases (a list of at most 8 commits); offers_for reads each job's base (commits.base_sha, a run's baseline_sha), and rank puts a job whose base the agent holds after priority, the rarer hardware and the more specific target, and before age. An agent that sends no bases is ordered as before.
  • docs/protocol.md, docs/architecture.md and docs/using.md say so.

Tested

  • test_scheduler.py: the new order in rank, offers_for with and without held bases, and bases refused when not commits.
  • DataFolderChecks: BasesHeld (the active base, kept ones by last use; none being built, without a game folder, or a variant's).
  • Not run locally: CI runs both suites.

🤖 Generated with Claude Code

A PC builds `main` again for most jobs: 144 of 183 in the last 14 days (about 13 minutes each warm, 65 cold), since a job's base is its PR's merge base. 100 of those 144 builds were of a base another PC had already built, so sending each job where its base already is saves most of them. (Building `main`'s head ahead of time would not: only 27 of the 144 were for the head; the median was 9 commits, 5 hours, behind.) **What changed** - Agent: the capabilities carry `bases`, the commits whose default base the PC holds whole (the active one, then the kept ones by last use, at most 8; `Workspace.BasesHeld`, read only). They are sent again after each job, as any change to the capabilities. - Coordinator: `check_caps` takes `bases` (a list of at most 8 commits); `offers_for` reads each job's base (`commits.base_sha`, a run's `baseline_sha`), and `rank` puts a job whose base the agent holds after priority, the rarer hardware and the more specific target, and before age. An agent that sends no bases is ordered as before. - `docs/protocol.md`, `docs/architecture.md` and `docs/using.md` say so. **Tested** - `test_scheduler.py`: the new order in `rank`, `offers_for` with and without held bases, and `bases` refused when not commits. - `DataFolderChecks`: `BasesHeld` (the active base, kept ones by last use; none being built, without a game folder, or a variant's). - Not run locally: CI runs both suites. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat: offer a PC first the jobs whose base it already has
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
CI / Coordinator tests (pull_request) Failing after 1m20s
CI / Agent build and checks (pull_request) Successful in 41s
CI / Coordinator image (pull_request) Successful in 8s
60ef74eea0
A job's base is its PR's merge base, so a PC builds main again for most jobs (77% of 183 in 14 days, about 13 minutes
each warm, 65 cold), and 100 of those 144 builds were of a base another PC had built. The agent now sends the bases it
holds (capabilities' bases: the active one, then the kept ones) and the scheduler offers it first, after priority, the
rarer hardware and the more specific target, the jobs whose base is one of them. An agent that sends none is ordered as
before.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean changed title from WIP: feat: offer a PC first the jobs whose base it already has to feat: offer a PC first the jobs whose base it already has 2026-11-19 20:13:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!105
No description provided.