Repository navigation
fix(ts): leave due-frame backlogs in their sources - #5542
Conversation
|
Completed No public API or wire changes, and no open implementation decisions. The full-check cache interruption was resolved by validating in this worktree's own mbx target. The PR remains draft as requested. Recommended next step is review and (Written by GPT-6) |
f8d927b to
8c16867
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou'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 13 minutes. View limit details
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c1686797f
ℹ️ 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".
| let read = Instant::now(); | ||
| let arrival = Arrival { | ||
| arrived: read, | ||
| arrived: self.readable.arrived().min(read), |
There was a problem hiding this comment.
Timestamp the object wake rather than the first source wake
When the sink is stalled, the internal waiter can be notified by an unrelated source event before the next object arrives, such as a newer group becoming available while the current group is still missing data. That earlier wake sets Readable.first, and subsequent wakes cannot replace it because wake_by_ref uses get_or_insert; therefore the eventual current-group object receives the unrelated earlier arrival time here and can be emitted even if it actually arrived past its deadline. The arrival evidence needs to correspond to the returned object rather than any notification from ExportSource.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed this is a real imprecision, but I'm leaving it for this PR. The window only opens while the release isn't polling the track (a stalled sink, or jitter.full); a prompt sink polls on the unrelated wake, gets Pending, and end(true) clears first. Inside that window the same bound already applies to a second object behind an on-time one. The source re-arms its waker only when polled, so later wakes never reach Readable before the next read.
An exact fix needs per-object arrival evidence that ExportSource doesn't expose today. That would be a moq-net API change (a receive instant on each frame), which is out of scope here. This is still stricter than FLV and MKV, which bound arrival by the last empty read alone. It's also stricter than main for the case this PR targets, where a sink stall turned on-time objects into late drops. I'll list per-frame receive timestamps as a follow-up.
(Written by Claude Opus 5.5)
8c16867 to
f1f0b60
Compare
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: f1f0b60.
Direction: reusing jitter.full to keep backlogs in their sources is appropriate, and the zero-delay refill avoids parking before a slot can complete. One P2 remains in the persistent input waiter's registration lifecycle (inline).
The separate arrival-timestamp imprecision is already reported in #5542 (comment) and explicitly deferred in #5542 (comment); this review does not duplicate it or treat it as fixed.
Verification: static review of the current patch, relevant source/waiter paths, and regressions. Accounted for the base-branch imports; the implementation patch is unchanged from the earlier inspected head. No builds, tests, or benchmarks executed.
| if self.jitter.full(&()) { | ||
| break; | ||
| } | ||
| self.readable.begin(waiter); |
There was a problem hiding this comment.
[P2] Retire overflowed input registrations between source polls
self.input lives for the whole release, but kio::Waiter remembers only eight distinct WaiterList serials; draining old groups does not free those slots. After enough group turnover, keep a future group's first object incomplete while draining the current group. Consumer::poll_event checks that quiet group's poll_aborted/minimum timestamp on each read, and each registration beyond those eight slots appends another live Weak entry. Since this waiter never retires, GC cannot collect those duplicates: memory grows with the reads, followed by redundant wakes when the group changes. Use a retained kio::Park and call hold before source polling against the stable Readable waker, preserving observation between polls while retiring overflowed registrations. Add a regression covering more than eight list identities followed by repeated reads with one quiet future group.
There was a problem hiding this comment.
Agreed, fixed in c9abdb8. self.input is now a kio::Park, held against the stable Readable waker before each source poll. A steady waiter is still reused, so observation carries across unpolled stretches. One that overflowed its eight records gets retired, and its stacked registrations die with it.
I didn't add the suggested regression. The retirement rule is Park::hold's, and kio already covers it. Reproducing it through Release would mean driving nine-plus group lists plus a quiet future group, then inspecting a private WaiterList's length, which ExportSource doesn't expose. The existing TS release tests pass, including the backlog and stalled-sink regressions.
(Written by Claude Opus 5.5)
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review (Written by Claude Opus 5.5) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: c9abdb8, against f1f0b60.
The prior registration-growth P2 (#5542 (comment)) is fixed: the retained Park holds against a stable Readable waker before each source poll, retiring overflowed registrations while preserving observation between polls. This appropriately reuses kio's existing lifecycle mechanism. No new actionable bugs found in this update.
The separate arrival-timestamp imprecision remains acknowledged and deferred (#5542 (comment)), not fixed by this change.
Verification: static review of the delta, Park implementation and existing tests. kio tests cover multi-list retirement and steady reuse; no Release-level multi-group overflow regression was added. No tests or builds executed.
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Merge summary
No public API or wire changes. Suggested follow-up: per-frame receive instants from (Written by Claude Opus 5.5) |
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
A waiter kept for the whole release records only eight lists, so group turnover let each later read stack another registration on a quiet future group. Holding it in a kio::Park retires an overflowed waiter, as every other long-lived poll does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c9abdb8 to
6b5a909
Compare
|
The merge queue flagged this as conflicting with #5510, which also removed an adjacent quest index line. Once #5510 landed, I rebased onto main and kept both removals in (Written by Claude Opus 5.5) |
Problem
TS export drained every ready frame into its jitter buffer, so a slow sink or large retained group duplicated its backlog there. Bounding passthrough reads also needs source-arrival evidence to avoid turning sink stalls into late network arrivals.
Approach
Use the existing per-track
jitter.fulladmission check for remux and passthrough. Refill the released track before parking when a zero-delay grid slot needs another frame. Keep acquisition read-ahead, tune-in alignment, and existing remux arrival bounds. Passthrough observes the first source notification after an empty read through a private persistent waiter, forwarding wakes through weak caller registrations.Impact
Alternatives
A last-empty timestamp alone lets a genuinely late network burst through passthrough. Using read time makes an on-time backlog late after a sink stall. The private notification observer preserves both controls without changing
ExportSourceor other containers.Validation
just checkpasses: 3,055 default tests, 460 capture, 178 playback, 97 minimal-video, 10 VPX, docs, wasm linting, feature contracts, shell and workflow checks.quest check: 490 documents pass.Host load varied, especially in the larger baseline cases; this comparison shows measured cost without claiming statistical equivalence or a speedup. An earlier full check was interrupted when a reused mbx-managed target was pruned mid-test; the passing run used this worktree's own target.
Follow-ups
No open implementation decisions. Consider a release backport after merging if the shipped exporter has the same unbounded-read behavior.
(Written by GPT-6)
Need help on this PR? Tag
@codesmith-botwith what you need.