Pipeline scheduler: avoid starvation when top ready tasks fail budget

t-660·WorkTask·
·
·
·Omni/Pipeline.hs
Created2 months ago·Updated2 months ago·pipeline runs →

Dependencies

Description

Edit

Problem

Spawn candidate selection happens before budget checks.

Current flow in runCycle: 1. chooseSpawnCandidates slots ... domainTasks picks up to max-active tasks 2. spawnForTask then checks budget per picked task 3. If picked tasks fail budget, scheduler does not refill from the rest of ready queue

This means affordable tasks later in the ready list can starve indefinitely.

Example

With max-active=8, if the first 8 domain-unique tasks are unaffordable, all 8 are skipped and the cycle ends with spawned=0 even if task #9+ could run.

Proposed fix

  • Make candidate selection budget-aware:
  • either prefilter by budget before slot capping, or
  • iterate through ready tasks until slots are actually filled
  • Preserve one-active-run-per-domain invariant while filling slots

Acceptance criteria

  • If any ready task has budget and no active-domain conflict, at least one run is spawned
  • Unaffordable tasks no longer block affordable tasks behind them in queue order

Timeline (1)

🔄[human]Open → Draft2 months ago