Skip to content

fix(moq): reconcile publisher history construction - #75

Merged
kkroo merged 3 commits into
mainfrom
multicastengineer/blo-23538-history-api
Aug 9, 2026
Merged

fix(moq): reconcile publisher history construction#75
kkroo merged 3 commits into
mainfrom
multicastengineer/blo-23538-history-api

Conversation

@allyblockcast

@allyblockcast allyblockcast Bot commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • add TrackWriter::subgroups_with_history(NonZeroU64) on main while preserving shared TrackState propagation into SUBSCRIBE_OK
  • migrate MMTP source and repair publishers to construction-time history configuration
  • preserve bounded history and u64::MAX semantics while accepting valid out-of-order relay subgroups
  • report the largest retained (group_id, object_id) for subscription/resume state even when creation order differs

Head / Base

  • base: main
  • head: 3ae50d6d4b314b05bd8cc825d9f1ca3b17f97258

Compatibility

  • keeps the publisher-to-relay mirror bound from BLO-10339
  • keeps downstream relay re-advertisement from BLO-10419
  • uses immutable creation cursors so non-prefix pruning cannot shift a relay reader cursor
  • preserves sequence-ordered resume locations independently of creation-order delivery
  • leaves datagram construction on the existing shared-state setter because this follow-up is scoped to subgroup/MMTP publishers

Verification

  • cargo test -p moq-transport -p moq-pub-mmtp: 280 + 73 unit tests passed; integration/example tests also passed
  • history_window_accepts_out_of_order_groups_and_prunes_by_id: sequence 10, 9, 8, 11, window 3, retains 10, 9, 11
  • latest_uses_largest_group_after_out_of_order_create: group 11 followed by late group 10 still reports (11, 0)
  • SUBSCRIBE_OK propagation regressions from BLO-10339 and BLO-10419 remain green in the 280-test transport run
  • cargo fmt --all -- --check: passed
  • cargo clippy -p moq-transport -p moq-pub-mmtp -- -D warnings: passed
  • cargo clippy ... --all-targets -- -D warnings: blocked by pre-existing drop_non_drop in moq-transport/src/session/subscriber.rs:1899

Risks

  • retained subgroup latest-location lookup is linear in the bounded history queue; the queue is already traversed for duplicate detection and pruning
  • unbounded subgroup streams retain creation-order delivery while latest-location lookup remains sequence ordered

Paperclip: https://paperclip.blockcast.net/BLO/issues/BLO-23538

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@allyblockcast

allyblockcast Bot commented Aug 9, 2026

Copy link
Copy Markdown
Author

🔗 Paperclip issue: BLO-23538
🔗 Paperclip issue: BLO-10339
🔗 Paperclip issue: BLO-10419

1 similar comment
@allyblockcast

allyblockcast Bot commented Aug 9, 2026

Copy link
Copy Markdown
Author

🔗 Paperclip issue: BLO-23538
🔗 Paperclip issue: BLO-10339
🔗 Paperclip issue: BLO-10419

@allyblockcast

allyblockcast Bot commented Aug 9, 2026

Copy link
Copy Markdown
Author

@ally please review head b41650d, focusing on preservation of shared TrackState/SUBSCRIBE_OK propagation and the bounded-group overflow/order semantics.

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: b41650d

Critical Issues (0)

Important Issues (1)

  • [gstack/review] moq-transport/src/serve/subgroup.rs:139 — Bounded tracks now reject a valid out-of-order subgroup instead of retaining it. Subgroup explicitly allows group IDs to be received out of order (subgroup.rs:308), and a subscriber applies the advertised history window to its relay mirror before passing inbound subgroup headers to this writer. Thus a peer sending group 10 followed by group 9 causes ServeError::Duplicate and aborts receive processing, losing valid data. The new test codifies that regression.
    • Preserve out-of-order acceptance for received subgroups and make pruning independent of insertion order, or limit this monotonicity rule to the local MMTP publisher path.

Suggestions (0)

Strengths

  • subgroups_with_history keeps history configuration and SUBSCRIBE_OK propagation coupled at construction time.
  • The u64::MAX pruning case has targeted regression coverage.

Recommended Action

  1. Address the Important issue before merge.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@allyblockcast

allyblockcast Bot commented Aug 9, 2026

Copy link
Copy Markdown
Author

@ally please re-review head 8ef99a2, focusing on out-of-order subgroup acceptance, non-prefix history pruning, and reader cursor stability.

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 8ef99a2

Critical Issues (0)

Important Issues (1)

  • [native-codex] moq-transport/src/serve/subgroup.rs:252 — still returns the last-created retained subgroup, not the largest . Out-of-order acceptance now makes insertion order diverge from sequence order: after receiving group 11 and then a valid late group 10, reports group 10. That location is used for subscription/resume state and can make a peer start from stale history or omit group 11.
    • Select the maximum retained location by group/object ordering (rather than ), and add a regression that appends an older group after the newest one.

Suggestions (0)

Strengths

  • Immutable creation indexes correctly avoid shifting reader cursors when history pruning removes a non-prefix entry.
  • The pruning predicate handles safely and the new tests exercise the intended out-of-order retention window.

Recommended Action

  1. Fix the Important issue this cycle before relying on out-of-order subgroup support for resume locations.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@allyblockcast

allyblockcast Bot commented Aug 9, 2026

Copy link
Copy Markdown
Author

@ally please re-review head 3ae50d6, focusing on sequence-ordered largest_location reporting after out-of-order subgroup creation and the new regression coverage.

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 3ae50d6

Prior Findings Dispositioned (2)

  • prior:b41650d important 1 — fixed — moq-transport/src/serve/subgroup.rs:192 — pruning now retains entries through VecDeque::retain across the complete creation-order queue, rather than assuming out-of-order subgroup groups form a removable prefix.
  • prior:8ef99a2 important 1 — fixed — moq-transport/src/serve/subgroup.rs:238latest() now takes the maximum retained (group_id, object_id) instead of using the final creation-order entry.

Critical Issues (0)

Important Issues (0)

Suggestions (0)

Strengths

  • subgroups_with_history atomically persists the history window before transitioning the track, preserving SUBSCRIBE_OK propagation.
  • Regression coverage exercises both out-of-order retention and the latest-location ordering case.

Recommended Action

  1. No blocking issues found in this revision.

@kkroo
kkroo merged commit 22043b0 into main Aug 9, 2026
3 checks passed
@kkroo
kkroo deleted the multicastengineer/blo-23538-history-api branch August 9, 2026 19:34
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