Skip to content

0.10.12: the MiMo audio and media HTTP tests wait for the media reservation to settle - #2026

Merged
jonathan308 merged 2 commits into
release/candidate-0.10.12dfrom
fix/mimo-audio-reservation-settle
Nov 12, 2026
Merged

jonathan308 merged 2 commits into
release/candidate-0.10.12dfrom
fix/mimo-audio-reservation-settle

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Test-only fix for the 0.10.12 DevNet qualification flake (earnings/MIMO-AAC-RACE.md). Targets release/candidate-0.10.12d (0b52123a18) so the morning tag's release run doesn't flake on it.

What

The reservation checks that read managedMediaReservationCountForTesting once after joining the request's lease now wait up to 10 s for it to reach 0 before asserting it. A leaked reservation still fails.

  • MiMoV26ManagedAudioProviderTests.assertNativeHTTPMedia (the AAC video and PCM8 WAV tests).
  • MiMoV26EncodedMediaIngressTests.testNativeMediaReleasePNGJPEGAndMP4GenerateThroughAuthenticatedRoutes (:375). The CI red run below showed it has the same race.

Before / after

Test-only change, no product code changes.

Behavior (the test's check after a 200 response):

flowchart LR
  subgraph Before
    A1["HTTP media request returns 200"] --> B1["join the request's lease: host task only"]
    B1 --> C1["read the reservation count once"]
    C1 -- "native retirement still running" --> F1["1, expected 0: flaky failure"]
    C1 -- "retired" --> P1["0: pass"]
  end
  subgraph After
    A2["HTTP media request returns 200"] --> B2["join the request's lease"]
    B2 --> W2["poll the count every 5 ms, up to 10 s"]
    W2 -- "reaches 0" --> P2["assert 0: pass"]
    W2 -- "still held after 10 s: a leak" --> F2["assert 0: fail"]
  end
Loading

Code: MiMoV26ManagedAudioProviderTests.assertNativeHTTPMedia and MiMoV26EncodedMediaIngressTests.testNativeMediaReleasePNGJPEGAndMP4GenerateThroughAuthenticatedRoutes each replace the single XCTAssertEqual(managedMediaReservationCountForTesting, 0) with a bounded wait followed by the same assertion. Engine code is unchanged: the reservation is still removed by the native retire closure (MiMoV26NativeLoadTransaction.swift:970-976, :1096-1103), after the terminal (EngineV2Bridge+Events.swift:226-231).

Why

Release run 43162424068 shard 5, attempt 1: the AAC video test failed at :270 with a count of 1 (expected 0) after a 200 response. Attempt 2 passed. CI (dev) run 43158852996 passed the same tree. The check raced the engine:

  • The bridge returns the request's terminal before the row's native retirement (EngineV2Bridge+Events.swift:226-231). The lease the test joins is host-task ownership only (MultiModelBatchSchedulerEngine+Registry.swift:183-185).
  • The reservation leaves the map only when its native side retires as well: the SDK's work.afterRetirement runs the transaction's retire closure on the engine queue (MiMoV26NativeLoadTransaction.swift:970-976, removeSettledMediaReservation :1096-1103).
  • In the failed run everything after :270 passed. Retirement reached .retired, which requires an empty map (:1321), and the ledger was back to 0. So the reservation was released moments later, not leaked.

No product code changes, and no step-3 fold touched this path.

Red-first

The old single read against a 0.3 s sleep injected into that retire closure:

  • Mac A (GPU runs, 06:13–06:21Z): the old check failed 5 of 5, at 0b52123a18 and at 0e6ac37885. Waiting for the count passed 3 of 3; the count reached 0 after 0.305–0.309 s. Without the injection: 10/10 pass at both commits.
  • CI (DO NOT MERGE: red-first evidence for #2026 (slower MiMo native media retirement) #2027, DO NOT MERGE, closed afterwards):
    • Injection with today's tests, run 43168133947: exactly three tests failed, all at their single read ("1" vs "0"): the AAC video and PCM8 WAV audio tests, and testNativeMediaReleasePNGJPEGAndMP4GenerateThroughAuthenticatedRoutes.
    • Injection with this PR's tests (641bbc938a), run 43171519156: green. All three tests passed, each waiting for the slower retirement.

No changelog fragment: a test-only change, and no gate requires one for it.

Validation, limitations, refactor pass

  • Red-first and green evidence: see above (Mac A GPU runs; DO NOT MERGE: red-first evidence for #2026 (slower MiMo native media retirement) #2027 on CI).
  • CI on this head: green, run 43171504994. Attempt 1's shard 1 hit a GitHub proxy 502 on submodule checkout, and that shard was re-run. Shard 2 ran all three changed tests, which passed: AAC 10.6 s, PCM8 2.7 s, PNG/JPEG/MP4 1.2 s.
  • Local: docs-impact-check is OK. docs-check is OK with submodules checked out.
  • Limitation: test-only, so it does not shorten the native retirement it waits for. That retirement is by design (MIMO-AAC-RACE: a race, not a leak).
  • Refactor pass: no refactor subagent was available in this session, so that gate is still open for the independent reviewer. My own review found no change worth making.

…settle

The DevNet 0.10.12 release run 43162424068 (shard 5, attempt 1) failed
`testNativeAudioReleaseAcceptsOpenRouterAACVideoThroughAuthenticatedHTTP` at
its reservation check: 1, expected 0. Attempt 2 passed, CI (dev) run
43158852996 passed the same tree, and the check raced the engine:

- the bridge returns the request's terminal to the client before the row's
  native retirement (`EngineV2Bridge+Events.swift:226-231`), and the lease the
  test joins is host-task ownership only;
- the managed media reservation leaves the transaction's map only once its
  native side retires too: the SDK's `work.afterRetirement` runs the
  transaction's `retire` closure on the engine queue
  (`MiMoV26NativeLoadTransaction.swift:970-976`, `:1096-1103`).

On a slow runner that retirement lands just after the join. In the failed
run the rest of the test passed: retirement reached `.retired`, which needs
an empty reservation map (`:1321`), and the ledger was back to 0.

`assertNativeHTTPMedia` (the AAC video and PCM8 WAV tests) now waits up to
10 s for the count to reach 0 before asserting it, so a leaked reservation
still fails. Red-first on Mac A with a 0.3 s sleep injected into that
`retire` closure: the old check failed 5 of 5 (at `0b52123a18` and
`0e6ac37885`); waiting for the count passed 3 of 3, reaching 0 after 0.31 s.

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

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Nov 12, 2026 6:56am UTC
darkbloom-status Ready Ready Preview Nov 12, 2026 6:56am UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 12, 2026 6:56am UTC

Request Review

@jonathan308

Copy link
Copy Markdown
Collaborator Author

Red-first evidence on CI: #2027 (DO NOT MERGE; closed when done).

…to settle too

The red-first run on CI (#2027: a 0.3 s slower native media retirement)
failed exactly three tests at their single reservation read: the two audio
HTTP tests fixed in the previous commit, and
`MiMoV26EncodedMediaIngressTests.testNativeMediaReleasePNGJPEGAndMP4GenerateThroughAuthenticatedRoutes`
(`:375`), which reads the count once after joining its leases: the same
race. It now waits up to 10 s for the count to reach 0 as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 12, 2026
…0.3 s slower retirement

Expected green: each reservation check waits up to 10 s for the native
retirement instead of reading once.

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

Copy link
Copy Markdown
Collaborator Author

Red-first evidence on CI is complete (#2027, now closed). With a 0.3 s slower native media retirement, today's tests fail exactly the three single-read checks (run 43168133947). With this PR's tests, the same injection is green (run 43171519156). This PR's own CI is green: run 43171504994.

@jonathan308 jonathan308 changed the title 0.10.12: the MiMo audio HTTP tests wait for the media reservation to settle 0.10.12: the MiMo audio and media HTTP tests wait for the media reservation to settle Nov 12, 2026
jonathan308 added a commit that referenced this pull request Nov 12, 2026
…iving mutants, production-width wording

From review-2026-2029 (#2026 and #2029 v1 ship; wording must-fix S1,
should-fixes S2-S6, notes N1 and N2):

- S1, wording: the managed Super slot serves up to 8 requests at once
  (`defaultConcurrentRequests`, halved by the load fit), and only images
  and videos one at a time; the one-request owner is the qualification
  hook's default. Fixed in both changelog fragments, the direct-mode
  refusal row and inference.md's Super media section.
- N1: at the image binding, a stacked wait now holds only while the owner
  keeps a request slot free besides the waiting image's own
  (`Owner.hasFreeLocalAdmission`). A waiting image no longer takes the last
  slot a text request would get; on a width-2 owner, with an image
  streaming, the next image is refused at once as before, and text beside
  it is served.
- S6: the DEBUG settlement seam runs in `execute` right after the answer is
  marked ended, not inside the mark, so a mark moved after the native
  settlement fails the settlement tests (mutant M7). `markEnded()` is
  synchronous again.
- Tests: the binding's refusals without a bound and behind one waiter are
  timed (< 500 ms, M1), including `encodedRGBSuccessCancellationAndBusyIsolation`'s;
  a cancelled binding waiter returns at once and leaves no waiter (M4); a
  drain ends a binding wait with `closed` at once (M8); the stacked image
  reserves only after the first image's charges are released, sampled at
  its first chunk (M10); the owner's free-slot rule; after the HTTP test's
  served waiter, an image behind a text answer is refused at once, so every
  request's progress returned with its admission (M5); and a width-2 HTTP
  test, the production shape, for the free text slot (S3). Owner
  cancellation (M3) was already covered.
- N2: one deadline (`stackedUntil`) already bounds both slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonathan308
jonathan308 merged commit bd7fde4 into release/candidate-0.10.12d Nov 12, 2026
32 of 34 checks passed

This branch was successfully deployed

3 active deployments
Preview – d-inference-landing — 5a1a5397 Deployed Nov 12, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 5a1a5397 Deployed Nov 12, 2026 by vercel[bot]
Preview – darkbloom-status — 5a1a5397 Deployed Nov 12, 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