Skip to content

fix(mux): bound sequence hole waits by max delay - #5999

Merged
kixelated merged 6 commits into
mainfrom
quest/m1/ts-reliability/hole-budget
Oct 20, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m1/ts-reliability/hole-budget

Conversation

@kixelated

@kixelated kixelated commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A missing group before a bare data marker parks container readers forever while the track stays open and paused. The marker has no timestamp to spend the media-age budget.

Approach

Track when a missing sequence first blocks delivery and wake the reader when the subscription max delay expires. Either the existing media-age rule or elapsed monotonic time can advance the cursor. Keep late groups within budget, reset the anchor for each new hole, and report a gap before the paused marker's end. Preserve skip warnings for genuine expired holes while keeping startup joins quiet. Complete the sequence-hole budget quest.

Impact

  • Public API: no new symbols or signature changes; existing max-delay controls also bound sequence-hole waits, including immediate expiry at zero.
  • Wire: unchanged. No container encoding, published draft, or terminal-disposition changes.
  • Behavior: paused readers resume without another arrival or track termination; contiguous timestamp boundaries retain their existing gap behavior.

Alternatives

A timestamp-only budget cannot advance behind bare markers. A separate timeout setting would duplicate the subscription's existing budget.

Follow-ups

  • An arrived group whose stream stalls before its first frame, ahead of a bare marker, still blocks until the stream resolves: the blocking-current-group skip needs a stamped successor. Bounding a stalled current group by wall time touches the media skip path, so it belongs in its own quest.

No open design decisions. Full local validation and an ad hoc real-browser exercise are complete; the pinned browser media/interop suites were not run.

Tests

  • Reproduced missing gap/end failures in Rust and JS before the fix.

  • Rust container consumer tests: 79 passed via just rs test, including clippy and mocked-time expiry, wakeup, late arrival, and fresh-hole budgets.

  • JS container tests: 143 passed; final manual-clock hole suite: 3 passed.

  • bun run --cwd js/hang check, focused Biome, Rust formatting, quest check, and git diff --check passed.

  • The first full just check passed its native checks but failed two watch replay warning assertions. The new expiry path reported gaps without the existing skip diagnostic.

  • At 11a02e278, the diagnostic is restored: both shared/post replay regressions, all 144 container tests, and Biome pass without changing timer or delivery behavior.

  • Full just check rerun passed at 11a02e27879006581321300de744a48801c4c692 (formal exit 0). No CI or review results claimed.

  • Ad hoc real-browser exercise passed at the same head using system Chrome 155.0.8059.79, explicitly selected with Playwright executablePath, and the existing web dev recipe. Real VP8 encode/container/decode/canvas playback advanced through red, green, and blue, then played the startup frame. A paused, open track missing sequence 1 delivered gap then end for bare marker 2 after 202.755 ms with a 200 ms budget, stayed waiting at 50 ms, and warned exactly once. Startup across an empty/reset group and a missing sequence delivered a frame with no gap or warning. No WebCodecs or page errors.

  • This was an in-memory container-to-WebCodecs browser exercise. It did not exercise WebTransport or the player element, run the pinned media/interop harness, or establish an --all result.

Iteration (merge with main, Codex review)

  • Merged origin/main, resolving the conflict with moq-dev/moq#5942: poll_malformed is gone from the read loop, buffer_all is now look_all, and main's separate finished-track hole arm stays folded into this PR's single hole arm.
  • Decision: a missing group that arrives after the hole deadline but before the reader observed it.
    • ✅ Deliver it (recommended): it is no longer a hole, and the PTS age rule still bounds its latency. Declined the Codex finding with reasoning in the thread.
    • Skip it: enforce the wall deadline on arrival, dropping playable media over a scheduling tie.
  • Public API and wire: unchanged by this round.

(written by GPT-6.1-Sol, iterated by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 3 commits October 19, 2026 13:30
Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
Report a genuine missing sequence when the hole budget advances the read cursor, preserving consumer diagnostics while keeping startup joins quiet. Timer and delivery behavior are unchanged.

Validation: both shared/post replay regressions now pass after the missing warning failed the full check; 144 container tests and Biome pass. Full rerun and real-browser playback verification remain pending.

Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Ad hoc browser playback verification passed at 11a02e27879006581321300de744a48801c4c692 (probe exit 0), with system Chrome 155.0.8059.79 explicitly selected through Playwright's executablePath.

Commands:

nix develop --command env MOQ_NO_OPEN=1 just web serve http://localhost:4443
nix develop --command bun .scratch/ts-hole-browser.ts http://localhost:5173/@fs/home/kixelated/work/moq/.worktrees/ts-hole-budget/.scratch/ts-hole-browser.html

The scratch probe imported this checkout's container, network, and clock source through Vite. It encoded three VP8 keyframes, delivered them through the real container consumer, decoded them with WebCodecs, and checked the resulting canvas pixels: red [255,0,0], green [0,129,0], blue [0,0,255].

With the publisher still open and paused, missing group 1 before bare marker 2 remained waiting at 50 ms, then delivered frame, gap, end after 202.755 ms for a 200 ms budget. It emitted exactly one skipping missing groups warning. Groups 3 and 4 resumed decoding. A separate startup case with an old empty group, an empty successor, and a missing sequence delivered its first video frame without a gap or warning. That frame also reached the canvas. No page or WebCodecs errors occurred.

This verifies in-memory container timing and real browser codec/canvas playback. It does not exercise WebTransport or the player element, run the pinned media/interop harness, or establish an --all result. No source or dependency changes were made. The browser closed normally and the development server was explicitly stopped.

(written by GPT-6.1-Sol)

@kixelated
kixelated marked this pull request as ready for review October 19, 2026 22:42
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b41caf0-3ab4-4126-b1a1-e27b60dc44f8
📥 Commits

Reviewing files that changed from the base of the PR and between 173b64e and 38a1062.

📒 Files selected for processing: 5
  • js/hang/src/container/consumer.holes.test.ts
  • js/hang/src/container/consumer.ts
  • quest/m1/ts-reliability/README.md
  • quest/m1/ts-reliability/hole-budget.md
  • rs/moq-mux/src/container/consumer.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T03:57:31.511601Z 38a1062 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11a02e2787

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread js/hang/src/container/consumer.ts Resolved
…ty/hole-budget

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated enabled auto-merge October 20, 2026 01:13
…ty/hole-budget

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4aefbce59a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

.hole_timer
.get_or_insert_with(|| Box::pin(moq_clock::sleep_until(wake)));
timer.as_mut().reset(wake);
let _ = waiter.poll_future(timer.as_mut());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Re-evaluate an already-ready hole timer

If the deadline passes between the elapsed check and this poll, poll_future returns Poll::Ready(()), but the result is discarded and the consumer subsequently returns Poll::Pending. Because a future that returns ready does not register or issue another wake, a paused track with no further arrivals can then remain blocked indefinitely instead of expiring the hole; handle the ready result by re-running the expiry decision rather than parking.

AGENTS.md reference: AGENTS.md:L18-L18

Useful? React with 👍 / 👎.

@kixelated
kixelated added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 20, 2026
@kixelated
kixelated enabled auto-merge October 20, 2026 02:53
…ty/hole-budget

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 304a618 Oct 20, 2026
12 checks passed
@kixelated
kixelated deleted the quest/m1/ts-reliability/hole-budget branch October 20, 2026 04:22
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