Skip to content

test(ts): grade the passthrough export packet by packet against its source - #5856

Merged
kixelated merged 2 commits into
mainfrom
quest/m2/ts-passthrough-export
Oct 17, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m2/ts-passthrough-export

Conversation

@kixelated

@kixelated kixelated commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

export ts --passthrough landed in #5349 with local byte and timing checks. The TS passthrough export quest still needed: a reusable packet/position and release-schedule oracle, fixtures the captures don't carry, deterministic group omissions, a T-STD verdict check on output against input, automated TSDuck/FFmpeg runs, and a nightly impairment test. Nothing in test/ts exercised passthrough.

Approach

Rust (merge gate, paused clock)

  • ts/oracle.rs (test-only): Admitted places the published objects on the source and reports the acquisition prefix. grade checks that each released object is the source's packets at its exact position, in order, stamped as published, never duplicated, and opened on a group's first object. It also checks each object goes out within 1 ms of its PCR time on one clock, so a gap leaves its time behind. It returns which objects are missing.
  • ts/fixture.rs: the Mux builder moved out of passthrough_test.rs, plus assorted and mpts. assorted carries a clock-only PID, PSI and SDT, a PES split across PCR intervals, adaptation stuffing, nulls, an unlisted PID, and the PCR wrap. mpts has two programs on their own clocks with unaligned random access points.
  • release_test.rs: the existing tests now grade through the oracle. New tests: the fixtures, a group never delivered, and a group cut short (aborted Old).
  • Mutation-checked: a rewritten byte, a duplicated object, and a release that re-anchors its clock after a skip all fail.

Harness

  • just test ts --passthrough (and --mpts, two ffmpeg programs with keyframes every 25 and 40 frames). just test ts-passthrough-capture runs it on the in-repo Kyrion capture, which passes T-STD.
  • test/ts/passthrough.py maps every captured packet to its source position. A position is only claimed after a 16-packet match, so a duplicated null cannot pass as a later one. It reports the prefix and any gaps by PID. On a complete capture, every compliance.py check (TSDuck structure, T-STD, system buffers) must give the capture the verdict it gives the admitted interval. decode.py then runs for the generated clip. Unit tests are in passthrough.test.py.
  • CI: PR steps for the generated clip, the Kyrion capture and the MPTS. A nightly step runs --passthrough --loss 1 --duration 120.

Measured locally on a loaded shared host:

  • Generated clip: byte-identical after a 3-packet prefix, and decode passes. T-STD gives FAIL on both source and capture, because ffmpeg's AAC overflows on its own.
  • Kyrion capture: 2,458-packet prefix (dirty start), T-STD PASS on both.
  • MPTS: identical.
  • 1% loss for 60 s: complete.

Impact

Decisions

Settled by the maintainer, each on the recommended option:

  1. Counting omitted groups: the recovery quest asserts it once feat(mux): report TS health and the export's release clock #5849's Release::stats().gaps lands. This PR adds no duplicate counter. dropped already counts late objects.
  2. Compliance is graded against the source: the passthrough arm requires the capture's verdict to equal the admitted interval's, not an absolute pass. The Kyrion step carries a T-STD pass.
  3. A gap fails the harness, --loss included, as holes.py gates the demux lossy arm. passthrough.py --loss-ok grades a high-loss capture by hand.

Alternatives

  • Grading the capture's absolute compliance: this fails on sources that are already non-conformant, which passthrough is meant to carry unchanged.
  • Matching single packets in the grader: an identical null or PAT packet a gap later would hide a duplicate.

Follow-ups

  • At 5% loss, passthrough delivered 23% of the packets, in 30 gaps, with only 1 object counted late. The rest were groups the relay aged out at the congestion ceiling test/ts/README.md describes. Carrying null padding makes this worse; that belongs to the BBR study.
  • On the loaded host, the passthrough release logged ±200-330 ppm drift and out_of_tolerance rising every 2 s on a clean loopback path. Worth a look under clock recovery.
  • A live release-timing arm (--passthrough --live) is not wired up; release timing is covered by the paused-clock Rust tests.

(Written by Claude Opus 5.5, updated by Claude Opus 5.5 to record the settled decisions)

🤖 Generated with Claude Code

kixelated and others added 2 commits October 16, 2026 22:59
…ource

A reusable oracle places every object a raw TS release writes at its exact
position in the admitted source interval and checks it goes out on the source's
PCR schedule, so a missing object leaves its time behind. Fixtures cover null
and unknown PIDs, tables, adaptation stuffing, a split PES, the PCR wrap and an
MPTS with unaligned recovery points, plus skipped and cut groups.

The TS harness gains a --passthrough arm (and --mpts) graded by passthrough.py:
every captured packet must be the source's in place, and every compliance check
must grade the capture as it grades that interval of the source. CI runs it on
the generated clip, a T-STD-passing capture and an MPTS, and nightly over 1%
loss.

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

Copy link
Copy Markdown
Collaborator Author

Outcome from the quest run: the quest's acceptance is covered except counting omitted groups, which waits on Release::stats().gaps from #5849 and is moved to the recovery quest (open decision 1). Local just check passes. The passthrough harness arms (generated, Kyrion, MPTS, and 1% loss for 60 s) pass on a loaded shared host. 5% loss is reported under follow-ups, not gated.

(Written by Claude Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review October 17, 2026 07:25
@coderabbitai

coderabbitai Bot commented Oct 17, 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 9 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: 771b3362-42eb-44e6-9057-b4938a492180
📥 Commits

Reviewing files that changed from the base of the PR and between 2fa16cc and 78ae2c8.

📒 Files selected for processing: 17
  • .github/workflows/ts.yml
  • quest/m1/ts-reliability/README.md
  • quest/m1/ts-reliability/recovery.md
  • quest/m2/README.md
  • quest/m2/ts-hitless.md
  • quest/m2/ts-passthrough-epoch-cuts.md
  • quest/m2/ts-passthrough-export.md
  • rs/moq-mux/src/container/ts/fixture.rs
  • rs/moq-mux/src/container/ts/mod.rs
  • rs/moq-mux/src/container/ts/oracle.rs
  • rs/moq-mux/src/container/ts/passthrough_test.rs
  • rs/moq-mux/src/container/ts/release_test.rs
  • test/justfile
  • test/ts/README.md
  • test/ts/passthrough.py
  • test/ts/passthrough.test.py
  • test/ts/run.sh
  • 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 17, 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-17T07:28:28.952398Z 78ae2c8 Draft marked ready
ℹ️ 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.

@kixelated

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

(Written by Claude Opus 5.5)

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary: this adds a test-only checker (oracle.rs) and test streams (fixture.rs) for the raw TS release, the harness arms --passthrough, --mpts and ts-passthrough-capture, graded by passthrough.py, and three CI steps plus a nightly lossy step. It deletes the finished quest. There is no public API or wire change.

Settled decisions (the maintainer chose the recommended option on each): counting omitted groups moves to the recovery quest behind #5849; compliance is graded against the source; a gap fails the harness, --loss included.

Review: Codex found nothing on 78ae2c8. CodeRabbit was rate limited. CI is green.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 43071c5 Oct 17, 2026
17 of 18 checks passed
@kixelated
kixelated deleted the quest/m2/ts-passthrough-export branch October 17, 2026 08:37
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