Skip to content

fix(moq-mux): a seek measures the group it closes to its estimated end - #9742

Open
kixelated wants to merge 1 commit into
mainfrom
fix/seek-measures-estimated-end
Open

kixelated wants to merge 1 commit into
mainfrom
fix/seek-measures-estimated-end

Conversation

@kixelated

@kixelated kixelated commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Producer::seek closed its group with no measured end, so the bitrate estimator measured the group only to its last frame's timestamp. Five 20 ms, 250-byte audio packets closed by a seek advertised 125 kb/s instead of 100 kb/s. Seeks close a group at every FLV, MKV, or HLS import seek. moq-dev/moq#9561 fixed the same overcount for an unbounded cut, and CodeRabbit found that seek still had it (thread).

Changes

  • Producer::seek measures a media group to its estimated end (capped at the seek), as an unbounded cut(None) does. Data tracks still pass none, since their items have no cadence.

Impact

Public API: none. Wire: none.

Behavior: the catalog bitrate of a track whose groups seeks close drops to what it carries (by a quarter for five-packet audio groups).

Caused by

No single PR caused this: seek measured to the last frame before moq-dev/moq#9561, which fixed only cut.

Validation

  • seeks_measure_the_last_frame (40 groups of five 20 ms packets, each closed by a seek 100 ms past its end) reports 125000 b/s without the fix and 100000 with it.
  • just check passes.

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown effort

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: d10f84c

  • Base: origin/main at f3315bb

  • Risk: medium, The change is a bug fix in the shipped moq-mux crate, where a seek now measures the group it closes to its estimated end, changing the bitrate estimate that producers advertise for non-data containers; it keeps the public API and wire format, so nothing breaks for consumers and a revert fully undoes it, so the worst case is a wrong bitrate estimate reaching relays and subscribers from the next release until it is reverted.

  • Classified: medium by Claude Code, claude-haiku-5-5, low effort, session 5ac152d1-9617-424c-a21f-cdd24a75d153

  • Risk file: bb7b1c0de60b

  • Reviewer: Codex, gpt-6.2-sol, low effort

  • Session: 01a21b86-b3b3-7d72-8b82-df58c518cc0a, round 1

  • Score: 10/10, By inspection, seeks now measure media bitrate through the estimated group end while preserving data-track measurement and published group boundaries.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

Producer::seek left the bitrate measurement at the last frame's
timestamp, so five-packet audio groups a seek closed advertised a
quarter more than they carry. It now measures as an unbounded cut does,
data tracks excepted. Found by CodeRabbit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 27, 2026 05:43
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Producer::seek now measures through the estimated end when it closes a group on a non-data track. Data tracks remain unmeasured. A new audio test checks that repeated seeks after five 20 ms packets preserve a 100 kbps bitrate estimate.

Merge Risk: Minimal · up to d10f8

This change corrects bitrate overcount for media groups closed by seeks and leaves data tracks unchanged. No actionable merge risk remains. A regression test covers the main audio case.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change that matters: Producer::seek now measures the group it closes to its estimated end. The changeset matches this. The title is 70 characters, which is within a reasonable leng…
Description check Passed The description explains the bug, the affected code path (Producer::seek), the reproduction numbers, the related prior fix in cut, the changed behavior, and the validation test. It matches the changes…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change that matters: Producer::seek now measures the group it closes to its estimated end. The changeset matches this. The title is 70 characters, which is within a reasonable length for a single-sentence title.

Full details: Description check

Explanation

The description explains the bug, the affected code path (Producer::seek), the reproduction numbers, the related prior fix in cut, the changed behavior, and the validation test. It matches the changeset.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 93bfc33f-e880-47a7-be61-372a931413e1
Commits

Reviewing files that changed from the base of the PR and between f3315bb and d10f84c.

Files selected for processing: 1

  • rs/moq-mux/src/container/producer.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

This branch has not been deployed

No deployments
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