Skip to content

Placement: least_loaded and best_fit allocation strategies, typed properties cached per pass - #2805

Merged
amankrx merged 3 commits into
TraceMachina:mainfrom
amankrx:pr/placement-strategies
Sep 28, 2026
Merged

amankrx merged 3 commits into
TraceMachina:mainfrom
amankrx:pr/placement-strategies

Conversation

@amankrx

@amankrx amankrx commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

What and why

Two allocation strategies beside the LRU default. least_loaded gives the next action to the worker with the most free room, so a worker that just joined an idle pool takes work instead of the busy veteran the LRU order picks. best_fit places an action on the worker whose room fits it most tightly, preferring a worker whose Priority properties match the action's, so a big worker's room is kept for big actions. Typed properties are now built once per pass and cached, rather than once per action per candidate.

How was this verified?

placement_test.rs: a newcomer takes the next action under least_loaded and the veteran under LRU; best_fit keeps the big room for the big action and prefers the worker whose zone matches. On a test cluster with best_fit, a mixed burst stopped landing small actions on the one large worker.

Risk

Low. The default strategy is unchanged; the new variants are opt-in through allocation_strategy. The cache is per pass and holds typed properties only.

AI assistance

An agent drafted the change and I reviewed every line.


This change is Reviewable

… the next action

(cherry picked from commit 5198dabc100cd02ea2fef8592e0e788bfbe20235)
…d per pass

(cherry picked from commit 70b110a98127b82710c53ff126b72a06367461de)
@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Sep 28, 2026 8:01pm UTC
nativelink-aidm Ready Ready Preview Sep 28, 2026 8:01pm UTC

Request Review

@MarcusSorealheis MarcusSorealheis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amankrx
amankrx merged commit a7cc44d into TraceMachina:main Sep 28, 2026
47 checks passed

This branch was successfully deployed

2 active deployments
Preview – nativelink — 5b1ed38f Deployed Sep 28, 2026 by vercel[bot]
Preview – nativelink-aidm — 5b1ed38f Deployed Sep 28, 2026 by vercel[bot]
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