fix: unblock adaptive scheduler bootstrap - #744
Conversation
Fixes #740 Signed-off-by: Eric W. Tramel <1223539+eric-tramel@users.noreply.github.com>
Greptile SummaryThis PR fixes a deadlock in the adaptive row-group scheduler's bootstrap phase: when no LLM wait leases were active yet, queued LLM demand could block all new row-group admissions before any endpoint work had even started. The fix gates the queued-demand block on
|
| Filename | Overview |
|---|---|
| packages/data-designer-engine/src/data_designer/engine/dataset_builders/async_scheduler.py | Bootstrap fix: gates queued-LLM-demand blocking on llm_leased > 0; adds full resource-state dicts to admission diagnostics alongside pre-existing scalar fields. |
| packages/data-designer-engine/tests/engine/dataset_builders/test_async_scheduler.py | Refactors existing stub setup into a shared helper; adds six new tests covering zero-lease bootstrap, post-bootstrap blocking, target growth/stability, and diagnostics shape. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[_adaptive_row_group_block_reason] --> B{deferred tasks?}
B -->|yes| C[return deferred_tasks]
B -->|no| D{next unadmitted RG exists?}
D -->|no| E[return no_pending_row_groups]
D -->|yes| F{row guard allows size?}
F -->|no| G[return max_admitted_rows]
F -->|yes| H{queued_total >= queue_guard?}
H -->|yes| I[return queued_task_guardrail]
H -->|no| J{llm_limit <= 0?}
J -->|yes| K[return no_llm_wait_resource]
J -->|no| L{llm_available <= 0?}
L -->|yes| M[return llm_wait_saturated]
L -->|no| N{llm_leased > 0 AND llm_available <= queued_llm?}
N -->|yes| O[return queued_llm_demand]
N -->|no| P[return None - admit row group]
Reviews (1): Last reviewed commit: "fix: unblock adaptive scheduler bootstra..." | Re-trigger Greptile
Review: PR #744 — fix: unblock adaptive scheduler bootstrapSummaryFixes a bootstrap deadlock in the adaptive row-group admission path in The fix gates the queued-LLM-demand block on Scope: 1 production file (5 added / 1 changed lines in scheduler logic), 1 test file (~125 lines of new tests + a shared helper). FindingsCorrectness — fix is sound
Observability — additive, low-risk
Test coverage — strong
The pairing of the equality-edge case ( Style / conventions
Minor suggestions (non-blocking)
Risks
VerdictLGTM. Small, well-scoped fix with a clear failure mode, an explanation that lines up with the code, and a thorough set of unit tests that pin both the bootstrap regression and the post-bootstrap behavior. The only nit worth acting on is a brief inline comment explaining why the |
andreatnvidia
left a comment
There was a problem hiding this comment.
Reviewed #744. No blocking findings.
Validated the GitHub/local diff, ran graphify, ruff on changed Python files, and the full changed scheduler test file (100 passed). Claude cross-review also found no actionable bugs or test gaps.
📋 Summary
Fix the adaptive row-group scheduler bootstrap condition so queued LLM demand cannot dead-end admission before any endpoint work has started. The queued-demand block now only applies after an LLM wait lease exists, and row-group admission diagnostics include resource demand/availability state for future no-progress reports.
🔗 Related Issue
Fixes #740
🔄 Changes
🧪 Testing
make testpassesAdditional validation:
make check-all-fixuv run pytest packages/data-designer-engine/tests/engine/dataset_builders/test_async_scheduler.py -q✅ Checklist