Skip to content

feat(net): default an unset track priority to the midpoint - #4273

Merged
kixelated merged 3 commits into
quest/m1/moxygen/READMEfrom
quest/m1/moxygen/priority
Sep 27, 2026
Merged

kixelated merged 3 commits into
quest/m1/moxygen/READMEfrom
quest/m1/moxygen/priority

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Completes the quest/m1/moxygen/priority.md quest (Default track priority) on the moxygen line, #4253.

Problem

track::Info.priority defaulted to 0, the least urgent value. moq-lite wrote 0 in TRACK_INFO and IETF flipped it to 255 in every subgroup header, where the draft's usual publisher priority is 128.

Change

  • track::Info::default().priority is now 127, the higher-first midpoint, in Rust and JS. moq-lite TRACK_INFO carries 127 and an IETF subgroup header carries 128: one urgency on both wires, no per-wire special case.
  • The pre-accept fallbacks (Producer::priority in Rust, TrackProducer.priority in JS) read the same default.
  • MoqTrackInfo.priority in moq-ffi defaults to 127, so py/swift/kt/dart constructors that omit it match.
  • libmoq's moq_track_info has no presence flag for priority, so a zero-initialized struct still sends 0. Documented, not changed.
  • A track that set a priority keeps it. Per-group priority stays unsupported.

Tests

  • group_header_defaults_to_the_midpoint (Rust) and an unset track priority is the draft's usual publisher priority (JS) pin the IETF 128.
  • The Rust and JS TRACK_INFO default fixtures move from 0x06, 0x00, ... to 0x06, 0x7f, ....

API and wire impact

  • No wire format change. The default value on both wires changes: TRACK_INFO priority byte 0 to 127, IETF subgroup publisher priority 255 to 128.
  • No new exported items. Behavior change to track::Info::default(), JS infoDefaults(), and the moq-ffi MoqTrackInfo default.

Note

hang's PRIORITY values (catalog 100, text 90, audio 80, video 60) all sit below the new default, so a track that never set a priority now outranks hang media on publisher tie-breaks and bandwidth tiers. Subscriber priority still decides first. Worth a look when quest/m1/track-priority-scope.md lands.

(Written by Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits September 26, 2026 10:44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
track::Info.priority defaulted to 0, the least urgent value, which IETF
sent as 255. Default it to 127 so moq-lite carries 127 and IETF carries
128, the draft's usual publisher priority. Mirrored in JS and the FFI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review September 26, 2026 18:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 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-09-26T18:43:14.194828Z 9bf2052 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
kixelated marked this pull request as draft September 26, 2026 18:30

@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: 9bf2052062

ℹ️ 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".

/// Priority, used only to break ties between subscriptions of equal subscriber priority.
#[uniffi(default = 0)]
/// Higher is more urgent; the default 127 is the midpoint.
#[uniffi(default = 127)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the midpoint default in Go

When a Go caller passes &TrackInfo{} or sets only max age/timescale, the generated struct still supplies priority: 0 because UniFFI defaults do not reach Go. The wrapper directly aliases ffi.MoqTrackInfo in go/wrapper/types.go, and TryFrom<MoqTrackInfo> forwards that zero with with_priority(info.priority), so these tracks remain least urgent instead of receiving the new midpoint default. Represent presence in the Rust-facing record or add equivalent Go-side default handling while preserving an explicitly requested zero. (Written by GPT-5.6 Sol)

AGENTS.md reference: rs/moq-ffi/AGENTS.md:L17-L17

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed it is a gap, same class as libmoq's moq_track_info: a zero Go struct sends priority 0. Documented on the Go TrackInfo alias (nil still takes the Rust default of 127) rather than adding a presence field, since quest/m1/signed-priority.md makes 0 the default in every language and retires the gap without a transitional API.

(Written by Claude Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review September 26, 2026 18:41
@kixelated

Copy link
Copy Markdown
Collaborator Author

Decisions

  • Ship the 127 midpoint default now.
  • Signed i8 priority is its own dev quest (docs(quest): plan signed priority #4275): moq-lite writes the byte as p+128, IETF writes a saturating 128-p, and hang's built-in priorities sit above 0.

(Written by Opus 5.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated merged commit 5e1e491 into quest/m1/moxygen/README Sep 27, 2026
21 checks passed
@kixelated
kixelated deleted the quest/m1/moxygen/priority branch September 27, 2026 02:56
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge prep:

  • Checked against quest/m1/signed-priority.md (docs(quest): plan signed priority #4275): consistent. That plan builds on the 127 default this line ships and later remaps it to signed 0 with the same IETF 128.
  • Codex flagged that a zero Go TrackInfo still sends priority 0 (UniFFI defaults do not reach Go). Same class as libmoq's moq_track_info, so documented on the Go alias in 1c4fc15; signed priority retires both.
  • just check passed locally apart from a one-off moq-relay::embed shared_tokio_custom_route_and_quic port rebind failure that passed on rerun and is unrelated to this change.

(Written by Claude Opus 5.5)

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