Skip to content

Nemotron Super video: retryable 503 for a spent decode allowance; tests decode under the ceiling - #1871

Merged
davidtai merged 3 commits into
devfrom
fix/nemotron-video-limit
Nov 6, 2026
Merged

davidtai merged 3 commits into
devfrom
fix/nemotron-video-limit

Conversation

@davidtai

@davidtai davidtai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Cause

NemotronSuperOpenRouterVideoTests.bothClipsPlanAndDecodeAtTheirGrid() failed with Caught error: .limit in run 42299987412, attempt 1, job 128176836877 (Darkbloom VM, shard 1). Attempt 2 of the same run passed.

  • The error: NemotronSuperVideoDecode.Failure.limit, thrown from Frames.next() while the test decodes the sampled frames. It is the decode allowance (decodeAllowance), not a frame, byte, pixel or memory limit. (Before this PR, .limit covered both; this PR gives the allowance its own case, decodeAllowanceSpent.) The inspect limits are fixed for these committed clips, and inspect, encodedVideoPlan and the reservation passed on every other run.
  • How we know: the shard's provider.profdata artifact. No other video-decode suite ran in shard 1. In SerialReader:
    • The wait closure in nextSample has counts [3946, 1]: 3946 reads were delivered and 1 wait timed out.
    • expire() ran once, and earlyEnd returned the expired branch once.
    • reopenAfterFailure was called once. It returned at its stopped guard ([1, 0, 0]), so no reader was replaced and no failed pass was reported.
  • Why the wait timed out: the allowance is wall time, sized at 10 times an idle M3 Ultra's hardware decode. That is about 5.7 s for the MP4 and 6.1 s for the MOV. The shard ran on a 12-vCPU VM with 3 test processes (busy vCPUs: p95 6.1, max 10.6). In that same shard, the sibling bothClipsServeOnTheInstalledFixture took 75.2 s against a 22.2 s median, so the machine was about 3.4 times slower than usual. The failing test took 33.2 s, the longest on record, against a 21–22 s median.

#1851 did not cause it. The retry did not run: no reader failed and none was reopened. The only change #1851 made on the path that ran is a nil test-hook call before each read. The same test also failed before #1851 merged (run 42135074979, 00:28Z). That failure was .inconsistentFrames, not .limit: a reader that ended early, which is the failure #1851 addresses.

Spread

bothClipsPlanAndDecodeAtTheirGrid in every Provider Unit Tests job of CI (dev) and CI (master) runs (PR and push) created since 2026-11-05: 204 runs, 166 executions.

Period Runner Runs Failures Median (s) p90 (s) Max (s)
Before b0fadbb9 Darkbloom VM 63 1 (.inconsistentFrames) 21.3 23.5 28.3
Before b0fadbb9 Blacksmith macOS 27 81 0 22.0 27.5 30.5
After b0fadbb9 Darkbloom VM 22 1 (.limit) 22.0 23.4 33.2

Fix

  • Tests: bothClipsPlanAndDecodeAtTheirGrid and the reader-retry tests' frames helper now decode under maximumDecodeAllowance. These tests check plans and frames, not timing. All their assertions are unchanged. The allowance keeps its own tests in NemotronSuperVideoDecodeTests (decodeAllowanceStopsTheReader, givingUpOnAReadNeverRacesTheReader).
  • Source: NemotronSuperVideoDecode.maximumDecodeAllowance gives a name to the existing 120 s ceiling of decodeAllowance. Behavior is unchanged.
  • New deterministic test: aReadThatOutlastsTheAllowanceSpendsItAndIsNotRetried. It holds the first read for 0.5 s with a 100 ms allowance:
    • the decode ends as decodeAllowanceSpent;
    • no failed pass is reported, and only one reader reads, so a spent allowance is never retried or counted twice;
    • with the ceiling allowance, the same slow read only arrives late, and the frames match an unhindered decode.
  • Production mapping: a spent allowance is now NemotronSuperVideoDecode.Failure.decodeAllowanceSpent. SuperHTTPErrors.map refuses it as requestRejected("inline video decoder outlasted its decode allowance; retry on another provider"). That is the retryable 503 (failure code capacity) that Decode a video again when its reader fails, and keep the cause #1851 uses for transient decoder faults. Failure.limit now covers only the movie's own limits (frame size, frame grid, source frames, control markers, decoded pixels), and those stay invalid_media (400).
  • Other decoders: the GLM 5.3, MiMo V2.6 and Qwen4 decoders (in mlx-swift-lm at the pinned commit, and their ProviderCore ingress) have no wall-clock decode budget. Their limits are byte, pixel, frame and duration bounds of the input, so their mapping is unchanged.
  • Mapping test: NemotronSuperVideoBindingTests.spentDecodeAllowanceIsARetryableRefusal checks that decodeAllowanceSpent maps to requestRejected and then to (capacity, 503), and that .limit still maps to (invalid_media, 400). The allowance tests in NemotronSuperVideoDecodeTests and the new slow-read test now expect decodeAllowanceSpent; the pixel-budget test still expects .limit.
  • Docs and changelog: docs/architecture/inference.md (the allowance paragraph, the video mapping sentence and a troubleshooting row), docs/provider/direct-mode.md (a refusal row) and the fragment changelog.d/nemotron-video-decode-allowance-retryable.md.
Before: test -> Frames(plan)                     -> wall-time allowance ~6 s -> loaded VM -> .limit (flaky)
After:  test -> Frames(plan, maximumDecodeAllowance) -> 120 s ceiling           -> frames checked
        allowance behavior -> NemotronSuperVideoDecodeTests + the new slow-read test (deterministic)

Before: spent allowance -> Failure.limit                -> invalid_media 400 (not re-routed)
After:  spent allowance -> Failure.decodeAllowanceSpent -> requestRejected -> capacity 503 (coordinator re-routes)
        movie limits    -> Failure.limit                -> invalid_media 400 (unchanged)

Production impact

Real requests can hit a spent allowance only when a provider's decoder wait for a clip exceeds it. For a short clip that is about 6 s, and it needs a slowdown of about 10 times against an idle M3 Ultra (for example a stalled media service or a heavily loaded Mac). Before this PR, such a request got invalid_media (400) for a valid video, and the coordinator did not re-route it. With this PR, it gets capacity (503), and the coordinator can send it to another provider.

Contract note: this changes the provider's refusal class for one failure, from invalid_media (400) to capacity (503). It uses an existing class and adds no new wire value. Per AGENTS.md, the platform owner should review it.

Risk: a movie built to decode slowly could cost each provider it reaches up to its allowance (at most 120 s), across the coordinator's retries. The plan's decoded-pixel budget still bounds the movie's work.

Validation

  • No local builds or tests, by policy. CI on this PR is the validation.
  • Static review: the new test's timing is one-sided. A 0.5 s hold against a 100 ms allowance always expires, and against 120 s it never does.
  • Refactor pass: no refactor subagent was available in this session, so this gate is open. A self-review deduplicated the read-hook helper (ending became reading(through:)).

🤖 Generated with Claude Code

bothClipsPlanAndDecodeAtTheirGrid failed with .limit on a loaded Darkbloom
VM (run 42299987412, attempt 1). The run's coverage counters show one
decoder wait that outlasted the decode allowance, then a stopped reader:
no reader failed and no reader was replaced, so the retry from #1851 did
not run. The allowance is wall time sized for an idle M3 Ultra (about 6 s
for these clips), and the same shard ran its sibling test 3.4 times
slower than its median.

The plan-and-decode test and the reader-retry tests check frames and
plans, not timing; they now decode under maximumDecodeAllowance, the
named 120 s ceiling of decodeAllowance. The allowance keeps its own
tests. A new test holds one read past the allowance: the decode ends as
.limit, no failed pass is reported, and the reader is not replaced; with
allowance to spare, the same slow read gives the same frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Error Error Nov 6, 2026 11:05pm UTC
d-inference-console-ui-dev Error Error Nov 6, 2026 11:05pm UTC
d-inference-landing Ready Ready Preview Nov 6, 2026 11:05pm UTC
darkbloom-status Ready Ready Preview Nov 6, 2026 11:05pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 6, 2026 11:05pm UTC

Request Review

The decode allowance is wall time on the provider, and the plan's decoded
pixels already bound the movie's work. A valid video that outlasts it on a
slow or loaded Mac is the provider's fault, but it left as invalid_media
(400), which the coordinator does not send elsewhere.

A spent allowance is now NemotronSuperVideoDecode.Failure.decodeAllowanceSpent,
which SuperHTTPErrors.map refuses as requestRejected: the retryable 503
(capacity) that transient decoder faults use. Failure.limit keeps the
movie's own limits (frame size, grid, source frames, control markers,
decoded pixels), still invalid_media (400). The GLM 5.3, MiMo V2.6 and
Qwen4 decoders have no wall-clock decode budget, so nothing else changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor pass for the decode allowance refusal. The direct-mode row said
the video's byte limits stay invalid_media (400), but a video over the
Super body bound is media_too_large. The row now names the limits that
throw NemotronSuperVideoDecode.Failure.limit, as the changelog does.
Two test doc comments are rewrapped. No code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidtai
davidtai merged commit 0ed9e55 into dev Nov 6, 2026
17 of 19 checks passed
@davidtai
davidtai deleted the fix/nemotron-video-limit branch November 6, 2026 23:20
jonathan308 added a commit that referenced this pull request Nov 10, 2026
… becomes 413/415

#1922's review items 2 and 3:
- protocol-messages.md and inference.md said the coordinator requires
  `native_media_controls` during rollout. Only a coordinator with platform
  #729 (on platform dev, not yet in production) does; without it such
  requests reach any Super Mac and a Mac without this build refuses them.
  Both now name #729 with a pinned link to `BuildNeedsNativeMediaControls`.
- #1871's fragment shipped in 0.10.11 saying a video's own limits stay
  `invalid_media` (400). That fragment is removed by the 0.10.12 release
  branch's master merge, so editing it would conflict; #1922's own fragment
  now says those limits, like the rest, were `invalid_media` (400) before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch had an error being deployed

2 failed and 3 active deployments
Preview – eigen-homepages-darkbloom — fcdf5279 Deployed Nov 6, 2026 by vercel[bot]
Preview – d-inference-landing — fcdf5279 Deployed Nov 6, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — fcdf5279 Deployed Nov 6, 2026 by vercel[bot]
Preview – d-inference — fcdf5279 Deployed Nov 6, 2026 by vercel[bot]
Preview – darkbloom-status — fcdf5279 Deployed Nov 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant