Repository navigation
fix(routing): explore idle providers without current first-content evidence - #1254
Merged
Gajesh2007 merged 2 commits intoSep 29, 2026
Conversation
…idence preferFirstContentCandidates drops every unknown candidate whenever one is feasible. Performance evidence is renewed only by serving, so a freshly connected session (no measurement) and any provider idle past the 2-minute freshness horizon (evidence ages out) can be excluded from deadline-bearing requests indefinitely: they need a request to earn evidence and need evidence to get a request. After 5 minutes without usable evidence, an idle, loaded candidate whose forecast is unknown only for performance_missing or performance_age_unknown_or_stale now stays in the pool beside feasible peers and competes on ordinary ranking. Its class stays unknown, so hedge and fresh-feasible requests still exclude it, and qualified evidence still wins within the bound (TestFirstContentFreshScanAndRetainedPlanPreferFeasibleBeforeVersion is unchanged and passes). The gap age comes from existing data: the dated measurement's age, else the connection's age. No new provider state. Refs Layr-Labs#1238. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brandon-eigenlabs
had a problem deploying
to
benchmarks
September 29, 2026 17:28 — with
GitHub Actions
Error
|
@brandon-eigenlabs is attempting to deploy a commit to the EigenLabs Team on Vercel. A member of the Team first needs to authorize it. |
Gajesh2007
had a problem deploying
to
benchmarks
September 29, 2026 23:50 — with
GitHub Actions
Error
jonathan308
approved these changes
Sep 29, 2026
This was referenced Sep 30, 2026
davidtai
added a commit
that referenced
this pull request
Sep 30, 2026
The 5-minute no-starvation bound and the fleet-median cost of an explored provider go beyond #1243 and #1254. #1254 admits an idle provider without a selection promise, and #1243 keeps an old decode rate for 30 minutes on purpose. Say so in the test comments and the routing doc, and say that the maintainers own the policy. Name the production constants that the test constants mirror, and say that the package test must switch to them after the fixes merge. Use the Swift provider's EWMA weight of 0.3 and blend every sample into the EWMA, including the slow setup samples. Results on master and on the local merge of both fixes are unchanged. Restamp docs/architecture/routing.md with today's date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Verified in production, from the read replica's routing records:
The cost half (#1243) is still open. Details and era dating: #1238 |
brandon-eigenlabs
added a commit
to brandon-eigenlabs/d-inference
that referenced
this pull request
Sep 30, 2026
…tions Layr-Labs#1254 admits an idle provider without current performance evidence and prices it at the fleet median. A provider whose engine keeps resetting clears that evidence every few minutes, and a first-content timeout is a 429 the node-health breaker deliberately ignores. In production one such provider (M3 Max decoding at ~11 tok/s against a ~79 fleet median) failed most of the explorations it won for hours with no tracker reacting. Two per-identity checks, scoped to exploration only: - Outcome backoff. An attempt selected through exploration reports back: a first-content timeout, deadline refusal or genuine fault (the breaker's own fault test) doubles a per-model suppression interval (5 min to 2 h); a delivered request halves it. Reset-on-success would not stop a provider that still completes short requests. - Remembered decode rate. Newly measured decode rates are kept per model across evidence resets and reconnects; a median of at least 5 below 0.25x the (model, chip family) fleet median makes the provider non-explorable. One slow observation never decides (the Layr-Labs#1238 lock-out); an observation at >= 0.5x clears the memory. Both live on the stable-identity gate (merged on migration, swept after 6 h, cleared by a provider version change). Neither quarantines: a suppressed provider still serves when nothing is feasible, and deadline refusals and first-content timeouts stay neutral for every health breaker. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
13 of 20 tasks
davidtai
added a commit
that referenced
this pull request
Oct 5, 2026
…rdinator/tests Port the idle-evidence ranking test and the closed-loop starvation simulation onto the mirrored test tree, in the external packages: - tests/registry/idle_evidence_ranking_test.go builds providers with the shared scheduler helpers, injects the fleet median through Dependencies.Throughput and the measurement history through Dependencies.Measurements, and reads each provider's effective decode rate and first-content forecast from its ReserveProviderEx decision. - tests/registry/routingsim/closed_loop_*_test.go register providers through Registry.Register with a test-owned registration message instead of the package's unexported simRegisterMessage, simModelInfos and armSimProvider. - The starvation bound now uses forecast.EvidenceExplorationAfter (#1254) instead of a copied 5-minute constant. The #1243 copy stays, because #1243 is not merged. The tests keep every assertion. They still fail on purpose where the routing code does not meet the proposed policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 6 tasks
Gajesh2007
pushed a commit
that referenced
this pull request
Oct 6, 2026
#1262) * Add closed-loop routing simulation and idle-evidence tests Extend routingsim with closed-loop tests. The provider that ReserveProviderEx selects serves the request, releases it, and reports a changed measurement through Registry.Heartbeat. Idle providers send unchanged heartbeats. The tests run under testing/synctest, so two simulated hours take less than one second. Each scenario runs on the legacy EWMA path and on the explicit measurement path. Scenarios from #1238: a slow last measurement, a freshly connected provider, a provider idle longer than the evidence window, and a healthy control fleet. Every idle, loaded provider must be selected within 5 minutes plus one request time. The control also limits the share of the busiest provider. Add registry tests for measurement monotonicity (an old idle decode measurement must not rank a provider below the same provider with none) and for the fleet-median cost of an explored provider. The starvation tests fail on master by design. They are the regression tests for #1243 and #1254. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * State that the starvation bounds are a proposed policy The 5-minute no-starvation bound and the fleet-median cost of an explored provider go beyond #1243 and #1254. #1254 admits an idle provider without a selection promise, and #1243 keeps an old decode rate for 30 minutes on purpose. Say so in the test comments and the routing doc, and say that the maintainers own the policy. Name the production constants that the test constants mirror, and say that the package test must switch to them after the fixes merge. Use the Swift provider's EWMA weight of 0.3 and blend every sample into the EWMA, including the slow setup samples. Results on master and on the local merge of both fixes are unchanged. Restamp docs/architecture/routing.md with today's date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: name the shared measurement age and fold heartbeat state branches measurementAge dates both the prefill and decode measurements in the idle evidence tests; the closed-loop heartbeat derives slot state and status once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(routing): move the closed-loop and idle-evidence tests under coordinator/tests Port the idle-evidence ranking test and the closed-loop starvation simulation onto the mirrored test tree, in the external packages: - tests/registry/idle_evidence_ranking_test.go builds providers with the shared scheduler helpers, injects the fleet median through Dependencies.Throughput and the measurement history through Dependencies.Measurements, and reads each provider's effective decode rate and first-content forecast from its ReserveProviderEx decision. - tests/registry/routingsim/closed_loop_*_test.go register providers through Registry.Register with a test-owned registration message instead of the package's unexported simRegisterMessage, simModelInfos and armSimProvider. - The starvation bound now uses forecast.EvidenceExplorationAfter (#1254) instead of a copied 5-minute constant. The #1243 copy stays, because #1243 is not merged. The tests keep every assertion. They still fail on purpose where the routing code does not meet the proposed policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the first-content router's evidence starvation loop: when any candidate is
feasible,preferFirstContentCandidatescurrently drops everyunknowncandidate, including healthy idle providers that need work to refresh their measurements.commitProviderReservation. If ownership changes after the scan, rescan rather than committing an obsolete idle choice.unknown: hedge and fresh-feasible requests still exclude it. Physical admission, trust, billing and the original deadline are unchanged.Integrated current
masterwithout rewriting the original contribution. The PR remains a coordinator-only change with no wire fields, schema, configuration knobs or provider release requirement.Before
flowchart TD R["Deadline-bearing request"] --> F["estimateFirstContent"] F --> P{"preferFirstContentCandidates:<br/>any feasible peer?"} P -->|"yes"| K["Keep feasible peers only"] P -->|"no"| U["Existing unknown fallback"] K --> D["Rank, reserve and dispatch"] U --> D K --> X["Idle provider with stale or missing evidence excluded"] X --> N["No work to refresh measurements"] N --> X classDef flow fill:#dbeafe,stroke:#2563eb,color:#172554 classDef guard fill:#fef3c7,stroke:#d97706,color:#451a03 classDef problem fill:#fee2e2,stroke:#dc2626,color:#450a0a class R,F,K,U,D flow class P guard class X,N problemAfter
flowchart TD R["Deadline-bearing request"] --> S["fillFirstContentSnapshot:<br/>include pending and unretired service"] S --> E{"firstContentEvidenceExplorable:<br/>loaded, idle, evidence gap,<br/>age at least five minutes?"} E -->|"yes"| P["Compete beside feasible peers;<br/>remain unknown"] E -->|"no"| F["Keep existing feasibility preference"] P --> K["selectFirstContentCandidate"] F --> K K --> C{"commitProviderReservation:<br/>eligibility still unchanged?"} C -->|"no"| S C -->|"yes"| D["Atomic admission and dispatch"] D --> O["Opportunity to refresh measurements;<br/>not a recovery guarantee"] classDef flow fill:#dbeafe,stroke:#2563eb,color:#172554 classDef guard fill:#fef3c7,stroke:#d97706,color:#451a03 classDef outcome fill:#dcfce7,stroke:#16a34a,color:#14532d class R,S,K flow class E,C guard class P,F,D,O outcomeBlue: request/code flow. Amber: guards. Red: prior lockout. Green: new outcomes. Without feasible peers, the existing unknown fallback is unchanged.
Validation
make coordinator-test(33 packages passed; database and opt-in hardware/evidence tests skipped because their local prerequisites were not configured)go test -race ./coordinator/registry -count=1go vet ./coordinator/registrymake coordinator-buildmake docs-impact-check BASE=origin/mastermake docs-check(324 documents; pinned MLX dependency initialized)The independent code review found no remaining actionable issues. Live-model performance and production behavior are not claimed by these tests; hosted CI is reported separately.
Evidence And Limits
The original investigation in #1238 reports idle-provider stalls and a small provider-side experiment. The fleet figures come from SELECT-only production-replica queries, not the public stats feed. Source inspection and deterministic tests independently establish the exclusion mechanism; the experiment is not a measured fleet-wide performance gain.
Refs #1238.