Skip to content

feat(moq-gst): add group-order feature, ascending/max-latency-ms properties, and consumer diagnostics#13

Merged
JoaquinBCh merged 5 commits into
benchmark-developfrom
feat/group-ordering
Jun 12, 2026
Merged

feat(moq-gst): add group-order feature, ascending/max-latency-ms properties, and consumer diagnostics#13
JoaquinBCh merged 5 commits into
benchmark-developfrom
feat/group-ordering

Conversation

@santi-ferreiro

Copy link
Copy Markdown

Summary

Builds on top of c7e8ab58 Add group-order support, which added transport-layer support for ascending group ordering (Track::ordered, group_ascending in the relay priority queue) but did not propagate it to the GStreamer plugin layer.

This PR completes the work by exposing ascending and max-latency-ms as first-class GStreamer properties on moqsrc, declaring the group-order Cargo feature, and decoupling the two axes so callers control them independently. Consumer latency is always Duration::from_millis(max_latency_ms) with no special-casing of ascending mode.

Additionally, the Consumer in moq-mux gains structured INFO log lines that let callers distinguish three distinct causes of frame loss: budget drops, stream errors, and ordering discards.

A pre-merge review caught two additional property API issues, fixed before merge:

  • None of the five ParamSpecBuilder chains called .mutable_ready(). Settings snapshot is taken once at ReadyToPaused and never re-read, so property writes after that transition are silently accepted but have no effect on the running session.
  • The ascending property was registered unconditionally but compiles to a no-op (let _ = ascending;) when built without --features group-order. A caller setting ascending=true would see the getter return true while the relay always got ordered=false. Fixed by emitting gst::warning! in the #[cfg(not(feature = "group-order"))] arm.

Changed files

  • rs/moq-gst/Cargo.toml — declares [features] section with group-order = [] (was referenced in source but never declared; building with --features group-order previously failed)
  • rs/moq-gst/src/source/imp.rs — adds max_latency_ms/ascending to Settings/ResolvedSettings, exposes both as GStreamer properties, adds .mutable_ready() to all five property builders, emits warning when ascending is set without the feature, extracts subscribe_track() helper to avoid duplicating the #[cfg] block for video and audio tracks
  • rs/moq-mux/src/container/consumer.rs — adds frames_in_current_group counter and three structured INFO log lines for loss attribution (budget drop / stream error / ordering discard)

Test plan

  • cargo build --release --features group-order compiles cleanly
  • moqsrc exposes max-latency-ms and ascending as inspectable GStreamer properties with correct defaults
  • Ascending mode confirmed working end-to-end: 0 frame losses at every loss level from 1% to 50%; descending with same budget shows 597 losses at 50% — relay is receiving and honoring the ordered flag
  • Stream errors and ordering discards confirmed absent under all test conditions; only budget drops appear in loss attribution logs

🤖 Generated with Claude Code

santi-ferreiro and others added 3 commits June 12, 2026 16:23
…roperties

- Declare group-order Cargo feature
- Add max_latency_ms and ascending to Settings/ResolvedSettings
- Expose max-latency-ms and ascending as GStreamer properties on moqsrc
- Set track_ref.ordered = ascending behind #[cfg(feature = "group-order")]
- Extract subscribe_track() helper to eliminate duplicated cfg block
- Consumer latency uses Duration::MAX when ascending, else max_latency_ms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ascending and max_latency_ms are now orthogonal: the consumer always uses
Duration::from_millis(max_latency_ms) regardless of ascending mode.
The subscriber sets G_MAXUINT64 as the default when ascending=true and no
explicit MOQ_MAX_LATENCY_MS is provided, preserving the unlimited-budget
behaviour of bare moq-ascending while allowing moq-125-asc and similar
variants to apply a real budget with ascending group ordering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… is no-op

Add .mutable_ready() to all five moqsrc property builders so settings can
be changed in READY state. Without this, writes after ReadyToPaused are
silently accepted but never applied to the running session.

Emit a gst::warning! when ascending=true is set but the group-order feature
is not compiled in, so callers get an explicit signal instead of silent
wrong behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces max-latency-ms and ascending settings to the moq-gst GStreamer source element, allowing users to configure group delivery order and latency. Feedback on these changes highlights a potential compilation error when the group-order feature is enabled due to a missing ordered field in the moq_net::Track dependency. Additionally, it is recommended to update the description of the max-latency-ms property, as it is no longer ignored when ascending is set to true.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread rs/moq-gst/src/source/imp.rs Outdated
Comment on lines +517 to +518
#[cfg(feature = "group-order")]
{ track_ref.ordered = ascending; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The moq_net::Track struct defined in rs/moq-net/src/model/track.rs does not currently have an ordered field. Enabling the group-order feature will result in a compilation error because track_ref.ordered does not exist.\n\nPlease ensure that the workspace dependency moq-net is updated to include the ordered field (as mentioned in the PR description regarding commit c7e8ab58), or that the required changes are merged/included in this branch.

Comment thread rs/moq-gst/src/source/imp.rs Outdated
santi-ferreiro and others added 2 commits June 12, 2026 16:39
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JoaquinBCh JoaquinBCh merged commit 078286a into benchmark-develop Jun 12, 2026
1 check failed
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.

2 participants