Repository navigation
Conversation
… answers it Whether a failed media preparation is the request's fault (400), this Mac busy (a retried 503) or a decoder fault was chosen by a cascade of casts with a default of "retry", copied into three catch chains. One error case, towerBudgetExceeded(String), carried both the artifact's own 32,000-patch limit and the operator's and the device's limits, and the default made all of them a retried 503 (#2191). MediaLimitOwner (artifact, operator, device) is now part of that error, and each throw site states it. EngineV2VisionPrefillError.disposition is a switch with no default, so a new case does not compile until its answer is chosen. MediaFailure.outward is the one mapping the single-Mac route and the two pair routes share; the one difference between them, that the Qwen pair publishes no refusal event, is an explicit property of the route. Nothing a coordinator sees changes. MediaFailureDispositionTests drives 47 errors through the three routes; all 141 answers (status, code, reason, text and telemetry event) are byte-identical to a pin taken on the previous code. Six answers that look wrong are listed by name in the test and left as they are: each is a status or reason the coordinator sees, so each flip is a reviewed change of its own. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ence count, a walk that keeps its rows) Independent behaviour-preserving cleanup. No production logic changes. - The table's known divergences were held to a ceiling (at most six), which let a corrected slot be refilled with another. The count is exact now. - A walk over an error type forced a switch arm, not a row: a wrong link dropped a row and nothing failed. eachWalkKeepsItsRows counts the rows of each walk. Shown red by skipping one link, then reverted. - "The three routes that prepare media" was false: MiMo's native media and Nemotron Super map their own failures. The header, the doc and the test say which three share this mapping. - A comment at one throw site still said it refuses retriably; the disposition decides that now. The reviewer compared outward with the three chains on dev cast by cast: identical through all five casts, differing only in telemetry, the model id and the request read for the media kind, each kept. All eleven owners are classified correctly. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
When preparing an image or a video for a model fails, the provider has three answers: the request itself is at fault (400), this Mac could not build the submission (a retryable 503 the coordinator reroutes), or the decoder failed just now. Which one was chosen by a cascade of
as?casts with a default of "retry", copied into three catch chains in the scheduler.One error case,
towerBudgetExceeded(String), carried both the model artifact's own fixed limit and the operator's and the device's limits, and the default made all of them a retried 503. #2191 fixed that for one limit.This PR makes the answer a property of the error, chosen once:
MediaLimitOwner(artifact,operatorLimit,device) is now part of that error, stated at each of 11 throw sites.EngineV2VisionPrefillError.dispositionis aswitchwith nodefault:. A new error case does not compile until its answer is chosen.MediaFailure.outwardis the one mapping the single-Mac route and the two pair routes share, replacing the three catch chains.Nothing a coordinator sees changes. Status, failure code, error reason, message text and telemetry are byte-identical for every error that can occur today.
Linked issue
Part of #2524 (decision 4: a cause is a value with one renderer). Independent of the other PRs in the epic.
Before
flowchart LR classDef bad fill:#cf222e,stroke:#82071e,color:#ffffff classDef ok fill:#1a7f37,stroke:#0f5323,color:#ffffff classDef step fill:#0969da,stroke:#0a3069,color:#ffffff T["Media preparation throws"]:::step --> R{"Which route"} R -- "single Mac" --> C1["Catch chain, copy 1"]:::step R -- "GLM pair" --> C2["Catch chain, copy 2"]:::step R -- "Qwen pair" --> C3["Catch chain, copy 3, no refusal event"]:::step C1 --> F{"clientFault cast ladder"} C2 --> F C3 --> F F -- "a listed case" --> A["400, the request is at fault"]:::ok F -- "default" --> B["Retried 503, whoever owns the limit"]:::badBehaviour: an artifact's own limit and this Mac's limit shared one error case and one answer. Code flow: three copies of the chain; the Qwen pair's missing refusal event was a fact about which copy you were in.
After
flowchart LR classDef bad fill:#cf222e,stroke:#82071e,color:#ffffff classDef ok fill:#1a7f37,stroke:#0f5323,color:#ffffff classDef step fill:#0969da,stroke:#0a3069,color:#ffffff classDef note fill:#9a6700,stroke:#633c01,color:#ffffff T["Media preparation throws, the limit's owner in the error"]:::step --> O["MediaFailure.outward, one function"]:::step O --> D{"disposition: switch with no default"} D -- "client fault" --> A["400, the request is at fault"]:::ok D -- "decode unavailable" --> U["503 media_memory_unavailable"]:::ok D -- "construction refusal" --> P{"route publishes refusal events"} P -- "single Mac, GLM pair" --> E["Event, then 503 capacity_busy"]:::ok P -- "Qwen pair" --> Q["503 capacity_busy, no event: stated, not accidental"]:::note N["New error case"]:::step --> X["Does not compile until it has an answer"]:::badBehaviour: identical for every request. Code flow: one mapping; the routes' one difference is a named property; who owns a limit is in the type.
What is pinned, and what is deliberately left wrong
MediaFailureDispositionTestsdrives 47 errors through the 3 routes: 141 answers, each a status, a failure code, an error reason, the outward text and the whole telemetry event. A pin taken on the previous code and the output after the change are byte-identical (cmpreports no difference).Six answers look wrong. Each is a status or a reason the coordinator sees, so each flip needs platform review and is a change of its own. They are listed by name in the test, with an exact count, so the list can only shrink:
artifactTowerLimitIsRetrieddisabledVideoIsRetriedpairImageRefusalIsUnmappedqwenPairPublishesNoRefusalTelemetrysuperCapacityCoversDeterministicRefusalstemplateFailureKeepsTheRefusalStatusTest plan
dev(5ce4b99783) with the three chains transcribed into the test, then green after. The 141-line pin file is byte-identical before and afterDARKBLOOM_RELEASE_ENVIRONMENT=prod swift build --jobs 6 --build-tests: completeswift test --skip-build --no-parallel --filter 'MediaFailureDispositionTests|MediaLimitOwnerTests|VisionTowerBudgetTests|EngineV2VisionRoutingTests|DistributedQwenMediaIngressTests|GLMClusterTensorParallelMediaTests|VideoReaderFailureMappingTests|GLM5NextMediaReservationTests': 152 tests in 20 suites pass (rerun independently after the refactor pass)CapacityQuoteEnginetests passmake docs-check(216 OK),make changelog-check(63 valid),make docs-impact-check BASE=origin/dev(OK)Would it have caught #2191? Partly, and the PR should not claim more. #2191's throw enforced the smaller of the artifact's and the operator's limit, which cannot be written now without stating an owner: that part is compile-time. But an artifact-owned limit answering 503 is one of the six listed divergences today, because three other artifact limits share that answer. So until the artifact answer flips, #2191's case would have appeared as a named entry in that list, not as a red build. #2153 is decode logic and is not covered.
Refactor pass
Done by an independent reviewer, second commit. No production logic changes.
dev. The reviewer comparedoutwardwith the three original chains cast by cast: identical through all five casts, differing only in telemetry, the model id and the request read for the media kind, each kept.Limitations and cautions for the follow-up flips
.artifactto 400 wholesale. At two sites (GLM5NextVisionBudget.swiftnear lines 43 and 57) and inadmit's overflow, the artifact owner fires only for an unusable artifact config or grid, never for an oversized request. A blanket flip would blame callers for an artifact defect. Only the 960,000-patch aggregate is a limit on the request.conflictingPlaceholderIdsis the same class: an artifact defect that fails every video request on every provider. The table marks it not artifact-owned, so it is in effect an unlisted seventh divergence.CaseIterablemirror of each error enum.decodeUnavailableand the typedmediaMemoryUnavailable.MiMoV26EncodedMediaIngress.swiftkeeps its default arms, and the three parallel switches inProviderLoop+ErrorMapping.swiftare unchanged.Components touched
Protocol / interface changes
Documentation impact
docs/architecture/inference.md(rule "native inference")No changelog fragment: nothing observable changes.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.