Repository navigation
feat(provider): the heartbeat sends the published decode rate's own age - #2672
Merged
Merged
Conversation
Each slot's capacity now carries observed_decode_tps_age_ms: whole milliseconds since publishedDecodeAt, the newest sample that moved the published rate (a reply of at least 32 tokens, or a calibration cell), so a short reply doesn't reset it. It is sent only with a published rate (encodeIfPresent; nil otherwise). The rate, the idle-age rule and every provider decision are unchanged; the coordinator's json.Unmarshal of the heartbeat (protocol/messages.go:1366-1371, no DisallowUnknownFields, no custom UnmarshalJSON for the slot) ignores the field until it reads it. Capacity events compare slots field by field, so the changing age triggers none.
1 task done
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jonathan308
added a commit
that referenced
this pull request
Nov 24, 2026
Conflict in docs/developer/serving-performance-qualification.md only: both paragraphs kept (the heartbeat rate's age, then the new slot's decode rate).
jonathan308
added a commit
that referenced
this pull request
Nov 24, 2026
This was referenced Nov 24, 2026
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
This is the provider half of the decode-rate age. Each slot's heartbeat now carries
observed_decode_tps_age_ms: the whole milliseconds sincepublishedDecodeAt, the newest sample that moved the published rate (a reply of at least 32 tokens, or a calibration cell). A short reply doesn't reset it. It's sent only with a published rate (encodeIfPresent, nil otherwise).Nothing else changes: the published rate, the idle-age rule (
DecodeRateIdleAge.published) and every provider decision are as before. The coordinator's ranking therefore can't change until its half lands.The platform's coordinator ignores the field today: it decodes the heartbeat with plain
json.Unmarshal(coordinator/protocol/messages.go:1366-1371), with noDisallowUnknownFields. NeitherBackendSlotCapacitynorHeartbeatMessagehas a customUnmarshalJSON(the protocol package's only ones are for App Attest messages and theProviderMessageenvelope,messages.go:1300). Unknown keys are therefore dropped.Capacity events don't fire more often:
CapacityEventHeartbeatscompares slots field by field and doesn't read this one, so a changing age triggers no extra heartbeat.Coordinator half (design, for its release): read the field, and decay a stale published rate toward the fleet median by the
forecast.ExploredRaterule instead of the provider dropping it to 0. Its five steps are wire, snapshot, decay, forecast evidence, and rollout with tests; the full note is below.8f9ac92b52DecodeRateIdleAge.publishedAgeMilliseconds) and the tests4fd38a1a64protocol-messages.mdrow,inference.md,serving-performance-qualification.md) and the changelog fragmentLinked issue
None. Follows #2628 (N1).
Test plan
ada4fd2317): the new tests on the base, with the property declared but never set or encoded. It must fail at exactlypublishedRateCarriesItsAgeandageWireShape.DecodeRateIdleAgeTests):publishedRateCarriesItsAge: no age without a rate; 60,000 ms after a qualifying sample; still the qualifying sample's age (160,500 ms) after a short reply, with the rate unchanged; no age once the idle rule drops the rate.ageWireShape: the key is absent when nil, present when set, and decodes back.python3 scripts/changelog.py check,python3 scripts/docs-impact-check.py --base origin/devComponents touched
Protocol / interface changes
observed_decode_tps_age_ms(an int64 in milliseconds, omitted when there's no published rate). The coordinator ignores it until its half lands. The console's TypeScript telemetry mirror needs the same optional field when the platform adds it.Documentation impact
Changelog
changelog.d/decode-rate-age-on-heartbeat.md.Notes for reviewers
There was no local build because the Macs are booked.
Coordinator half (design)
The provider half (d-inference PR "the heartbeat sends the published decode rate's own age") adds an optional
observed_decode_tps_age_msto each slot. It's the milliseconds since the newest sample that movedobserved_decode_tps, and replies under 32 tokens don't reset it. The coordinator ignores the field today: heartbeats are decoded with plainjson.Unmarshal(coordinator/protocol/messages.go:1366-1371), there's noDisallowUnknownFields, and the slot types have no customUnmarshalJSON.ObservedDecodeTPSAgeMS *int64 \json:"observed_decode_tps_age_ms,omitempty"`toprotocol.BackendSlotCapacity(messages.go ~510). nil means an older provider, so behaviour stays as today. Clamp it incapacityvalue.normalize` (non-negative, at most a day).routing_snapshot.go:75copies it besideobservedDecodeTPS(and so doescandidate_snapshot.go).performance.Rates(rates.go), take the slot's own rate throughforecast.ExploredRate's rule when the age is known:EvidenceExplorationAfter, the own rate as is;IdleMeasurementMaxAge, in whole minutes, so a reservation's quote and its commit read the same price;This replaces the provider's idle zeroing as the defence against a stale stacked rate.
first_content_evidence.go:22passes the decayed rate. A slot serving only short replies stays "known" (noperformance_missing, forecast.go:223-225) at a rate that drifts toward the median instead of being dropped. A slot that is both busy and stale is priced near the median, not at its old rate.DARKBLOOM_DECODE_RATE_IDLE_MAX_AGE_SECONDSto off, so the rate isn't zeroed; that's a separate provider PR. Tests:Before And After
flowchart LR subgraph Before S1[slot capacity] --> H1["observed_decode_tps"] end subgraph After S2[slot capacity] --> H2["observed_decode_tps (unchanged)"] S2 --> A2["observed_decode_tps_age_ms = now - publishedDecodeAt"] A2 -.ignored until the coordinator's half.-> C2[coordinator] endRefactor Pass
Refactor pass: done; no behaviour-preserving changes warranted.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.