Skip to content

fix(net): bound sparse-key reader records by structural coalescing - #9579

Draft
kixelated wants to merge 27 commits into
mainfrom
quest/m1/steady-broadcast-growth
Draft

kixelated wants to merge 27 commits into
mainfrom
quest/m1/steady-broadcast-growth

Conversation

@kixelated

@kixelated kixelated commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m1/steady-broadcast-growth.md (deleted here). Adds quest/m1/lite06-sparse-skips.md for the remaining lite-06 work (export warnings, full 900 s steady check, and Nightly lane).

Closes #9539

Summary

On a steady live broadcast over moq-lite-07, moq-relay, moq import ts --passthrough and moq export ts --passthrough now level off instead of growing by about 75 to 100 bytes a group. A Nightly steady run fails if that growth comes back.

Cause. Every append_group, and every GROUP_END on a received copy, skips the keys between consecutive group starts. Each live reader grew one run per group across Record::reported (distinct Settled / Dropped / Skip variants never merged in RangeMap), Record::delivered (arrival-order readers never absorbed declared skips), front copies (resume::Reader::take never settled handed-out keys in the copy's reported map, and resume::Reader::poll_drop filtered out Hole::Skip using delivered), and Misses (never pruned covered runs). Records folded only under pool debt, which a stock pool never reaches.

Fix (moq-net and @moq/net). Structural coalescing replaces Fold::Final and removes all retroactive fold heuristics (Fold::Final, Record::handed, Record::hold, Beside::held/next_stale, Spans/whole, and Logical::{ordered, reports}):

  • Two-variant Report (Final | Withdrawable). Only an Ordered reader's unreturned stale gap stays Report::Withdrawable (so a wider budget can withdraw it in Cursor::rejudge). Every wire report (served groups, declared skips, final drops, and stale OLD drops) and every returned gap is Report::Final, so adjacent final runs coalesce directly inside RangeMap.
  • Skip-only absorption into Record::delivered. Declared Hole::Skip runs (keys never produced) are absorbed into delivered via Delivered::absorb_skip only where they extend an existing run rightward (or start at 0), clipped to local cursor bounds (floor..end_key). Drops (Hole::Drop) are never inserted into delivered, so a group reported dropped that arrives whole later is never skipped, and a lagging viewer skipping groups as stale never creates disjoint runs in delivered.
  • Delivered-gated Misses pruning. Misses::forget runs only on ranges covered by Record::delivered once drops are polled (self.drops.is_some()), so uncovered fill verdicts are never lost and pre-poll_drop misses stay intact.
  • Front copies (resume). resume::Reader::take calls sub.settle_if_dropping(group.start) so copies that poll drops coalesce handed-out keys with surrounding skips, and resume::Reader::poll_drop exempts Hole::Skip from delivered filtering so logical.record.reported always receives and coalesces skips.
  • JS mirror (js/net). Mirrors structural coalescing in Delivered::absorbSkip, Subscriber (#reported coalescing all final reports, #absorbSkips, #stoppedReading), ResumeSource (settleIfDropping, absorbSkips, skip-exempt #tryDrop), and lite/publisher.ts (skipSettled).

Nightly steady run (just test steady, test/steady/).

  • The chain: live ffmpeg (every frame an IDR, 60 groups/s) -> import ts --passthrough -> relay -> export ts --passthrough, over lite-07, built with the profiling profile and jemalloc.
  • test/lib/growth.py samples each process every 5 s: VmRSS, /proc I/O, and the exact jemalloc allocated/resident, which moq_tokio::jemalloc now logs on every SIGUSR1 alongside its heap dump.
  • It judges each process by its Theil-Sen slope after warm-up and fails naming the process. A stalled chain (import not reading, export not writing) also fails.
  • A failed run uploads its samples, logs, binaries and heap dumps.
  • The relay soak quest now reuses the judge.

Decisions

  • ✅ (maintainer, 2026-11-26) Replace Fold::Final with structural coalescing (Approach 3: Report::{Final, Withdrawable}, rightward skip-only absorption into delivered, delivered-gated Misses pruning, front-copy settlement, and JS mirror) instead of patching Fold::Final or settling spans retroactively. Applied in 06350da963 (merged origin/main at dc0eb1a2f7 including feat(net)!: remove FETCH from lite-07 and serve fetches via bounded SUBSCRIBE #9687).
  • ✅ (maintainer, 2026-11-26, comment) Codex's finding 1 (record.rs:690, coalesced drops lose a skip upgrade): accept it (rejected: fix with a new Report variant). Applied: the merge of main made it moot. moq-dev/moq#9686 reports nothing twice, so a skip no longer goes out over a drop, and the guard it named is gone (af56870).
  • ✅ (maintainer, 2026-11-26, same comment) Codex's finding 2 (record.rs:517, fill verdicts): fix as Codex recommends, forgetting misses only where the fold records replacement coverage in delivered or raises the floor, with a unit test (rejected: accept). Applied in 2e11b6e and preserved structurally in 06350da963 (misses_keep_uncovered_fill_verdicts_and_prune_covered_ones).
  • ✅ (maintainer, 2026-11-25) Keep quest/m1/lite06-sparse-skips.md in m1.
  • ✅ (maintainer, 2026-11-24) Measure the Nightly run's length by seeding a known leak, then pick the shortest run that reliably flags it while a fixed build passes (rejected: pick a length up front). Applied: 900 s judged after 300 s, failing above 32 B/group of allocated heap. Over 300-900 s the fixed build's worst process grew +9.3 B/group and the leak's mildest +73.0. A 600 s run judged after 180 s was too short: the fixed import's heap was still warming up (+22.7 B/group), within 1.4x of the 32 B/group limit. The table is in test/steady/README.md.
  • Taken while the maintainer was away, for review:
    • Judge allocated bytes only; record RSS and resident. RSS couldn't separate the two builds at this length: the leak's slope ran +9 to +59 B/group, while the fixed relay swung to +140. The quest asked for "a resident or heap slope", so judging heap meets it.
    • lite-07 only in the Nightly; lite-06 to its own m1 quest. With Report::Final, lite-06's reported map now coalesces too (a 30-120 s lite-06 check ran +22 B/group on relay and +10 B/group on export, down from ~75 B/group), while the export's per-group "media skipped upstream" warning, full 900 s steady check, and Nightly lane stay with quest/m1/lite06-sparse-skips.md.
    • Exact jemalloc stats over sampled profiles. tikv-jemalloc-ctl's stats feature, logged on SIGUSR1. Sampled dump totals swung by 9 MB between dumps while the exact heap moved 1 MB.
    • The profiling cargo profile (release with line tables), so a failing Nightly's heap dumps name their stacks.

Validation

  • On 06350da963 (structural coalescing, merged origin/main dc0eb1a2f7):

    • just rs test -p moq-net --features async: 3,931 unit + 665 integration + 5 send + 16 doctests passed.
    • just rs test -p moq-net --no-default-features: 1,721 unit + 2 integration + 15 doctests passed.
    • just check: all Rust checks, rs_cross, cargo_nix, biome, dead_code, flake, carla_bridge, markdown, gh, tooling, quest, coverage_tables, and 11,658 Rust workspace tests passed.
    • just js check and just js test: all 35 JS packages typecheck, build, API reports, Node.js load tests, and unit tests (3,952+ @moq/net tests) passed.
    • /verify-subscribe: CutGroupEnd.cfg passed (28,943 distinct states, 0 errors); SubscribeAccounting.tla itself is unchanged from origin/main (83.9M distinct states on main).
    • New regression and property tests covering all four review findings:
      • model::record::test::final_reports_coalesce_and_skips_never_fragment_delivered
      • model::record::test::withdrawable_report_stays_distinct_and_untell_preserves_delivered
      • model::record::test::structural_coalescing_matches_reference_model (64-seed x 250-step differential property test against key-by-key reference model, including Accounted::first_gap)
      • model::track::test::a_late_whole_group_after_a_reported_drop_is_still_delivered (Finding 1, both arrival-order and ordered)
      • model::track::test::misses_keep_uncovered_fill_verdicts_and_prune_covered_ones (Finding 2)
      • model::track::test::lagging_stale_drops_and_late_group_end_keep_a_bounded_record (Finding 3 + out-of-order GROUP_END under Start::Oldest)
      • model::resume::tests::a_front_ordered_read_of_a_sparse_track_keeps_a_bounded_record and a_front_arrival_read_of_a_sparse_track_keeps_a_bounded_record
      • JS mirrors in js/net/src/track.test.ts (a sparse live track keeps a bounded record) and js/net/src/resume.test.ts (a front read of a sparse live track keeps a bounded record)
  • just test steady (900 s, judged after 300 s, 32 B/group limit), lite-07 at 60 groups/s, allocated slope per group:

    Head Import Relay Export Result
    06350da963 (structural coalescing, this head) +11.8 -1.2 -6.5 pass
    2e11b6e490 (previous Fold::Final) +13.3 -2.5 +1.5 pass
    c312ffe1e2 +11.0 +0.4 -3.1 pass
    eb8b03a8fd +10.8 +1.1 -3.7 pass
    d25c7ca449 +13.7 +0.1 -4.9 pass
    67be54a4a6 (spans, without handed) +16.2 -2.6 +37.0 fail, twice
    34db207763 (skip-based) +9.8 +1.9 -2.7 pass
  • Earlier, on the skip-based fold: 3,600 s judged after 120 s grew +1.5, +2.2, +0.7 B/group, and the seeded leak (main's record) +78.1, +75.6, +98.4. The sizing table is in test/steady/README.md.

  • Nightly fit, for the 60-minute tests job on the hosted arm runner: last night's Mesh replay built moq-relay, moq-bench and moq-shaper with fat LTO in 6m51s there, with dependencies cached. Here, with plain cargo at -j4, that build took 193 s and the steady build 381 s with dependencies built, 493 s fully cold. At the same 2.13x ratio, the steady build takes about 13.5 min on the runner, 17.5 min cold. With about 1.5 min of setup and the 15.5-minute run, the job takes about 31 min, 35 min cold, so the timeout stays and the profile keeps its fat LTO.

  • Quick 120 s (judged after 30 s) lite-06 check on 06350da963: import -7.0 B/group, relay +22.2 B/group, export +9.9 B/group (down from ~75 B/group before Report::Final).

Public API / wire

  • No wire change.
  • moq-tokio's jemalloc feature now also enables tikv-jemalloc-ctl/stats and logs jemalloc heap allocated=... resident=... on each SIGUSR1. No public API change.
  • Report::{Final, Withdrawable}, Delivered::absorb_skip, Record::absorb_skip, track::Subscriber::{skip_settled, settle_if_dropping}, and Pool::recorded (test-only) are crate-private; JS mirrors (Delivered.absorbSkip, WireRecord.skipSettled, hooks.{settleIfDropping, absorbSkips}) are package-internal.

Caused by

Follow-ups

  • quest/m1/lite06-sparse-skips.md: verify full 900 s steady behavior on lite-06, suppress the export's per-group "media skipped upstream" warning on inter-group gaps, and add a lite-06 lane to the steady Nightly.

Models

Size: L
Implementer: Claude Code, claude-opus-5-5, unknown
Implementer: Claude Code, claude-opus-5-5, unknown (iterate, L)
Implementer: Claude Code, claude-opus-5-5, unknown (iterate, L)
Implementer: Claude Code, claude-opus-5-5, unknown (iterate, M)
Implementer: Antigravity, gemini-4-neon, unknown (iterate, L)

(Written by Gemini 4 Neon)

Review

Rewritten by quest review after each round.

  • Head: c73d522, named in full once no reviewer reports a finding

  • Base: origin/main at 7279350

  • Risk: high, it changes .github/workflows/nightly.yml, which is always high: workflows run with the repository's secrets

  • Classified: high by the always-high paths

  • Risk file: bb7b1c0de60b

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

  • Session: 01a21b0c-2bc6-74f3-9f13-42722c3cc036, round 3

  • Score: 6/10, The head needs rework because a range widening can lose a queued skip under cache debt and nested JavaScript fronts can still grow delivery records indefinitely.

  • Rounds: 8; first round 2 (medium 2); findings 13 (medium 13): fixed 11, refuted 0, open 2

  • Findings, open until the next round settles them:

    • Medium, rs/moq-net/src/model/resume.rs:3564: Preserve skip remainders folded into the serving copy’s report floor
    • Medium, js/net/src/track.ts:5519: Follow nested fronts when looking up skips to bridge
  • The last round's findings, at c1af778:

    • Open: medium, rs/moq-net/src/model/resume.rs:3496: Check current range coverage before returning a queued skip; The coverage check at rs/moq-net/src/model/resume.rs:3527 prevents retired skips from escaping, but the revocation at line 3571 cannot replay a remainder already folded into the serving copy’s report floor.
    • Fixed: medium, rs/moq-net/src/model/track.rs:11654: Keep unreported skip bridges out of the report floor; The hand-out path at rs/moq-net/src/model/track.rs:11702 requires tracked reports to cover the gap before bridging it, and untracked readers require current range coverage.
    • Fixed: medium, js/net/src/delivered.ts:110: Revisit declared skips behind multiple open gaps; The revision scan at js/net/src/track.ts:3548 revisits newly declared skips even when several newer gaps remain open, fixing the original single-front overlap case.
  • Reviewer: Claude Code, claude-opus-5-5, high effort, second

  • Session: 22348feb-68ef-4b28-9957-7a6d04f8480a, round 3

  • Score: 6/10, Last round deleted the per-reader skip copy-and-revoke machinery, and this round's fixes bring it back under new names; the approach is overbuilt again even though I found no definite user-facing bug in it.

  • Recommendation: Stop moving declared skips into each reader's `delivered`. Make the run accounting read the track's own skips instead. Wherever `Delivered` or `Record::final_end` counts a gap (billing, `forget_past_budget`, and the debt fold), treat a gap that `TrackState::skip_end` fully covers as no gap. A declared skip is a property of the track, and every reader sees it at the moment of counting. The result does not depend on when a skip was declared relative to hand-out, on how many groups overlap, on whether the reader reports, on its range, or on its route. That removes `bridge_skip(s)`, `tell_skip`, the revision rescans (`drops_bridged`), the `has_reports` mode, and the revoke/untell paths. It leaves only `Report::Final` coalescing, which already bounds `reported`.

  • Rounds: 8; first round 4 (medium 4); findings 8 (medium 8): fixed 6, refuted 1, open 1

  • Findings, open until the next round settles them:

    • Medium, rs/moq-net/src/model/resume.rs:3527: Fixes for skip bridging rebuild the copy-and-revoke machinery the last round deleted

kixelated and others added 2 commits November 24, 2026 19:29
…s it goes

Every append_group (and every GROUP_END on a received copy) skips the keys
between consecutive group starts, so each live reader reports one skip per
group. Its record folded only under pool debt or when its ranges moved, and a
pool with room to spare never owes, so the relay, `import ts --passthrough`
and `export ts --passthrough` grew one record entry (and one given-up miss)
per group for as long as the broadcast ran.

Record::settle now also runs a lossless fold (Fold::Final) whenever the record
has doubled since its last fold: it folds delivered keys and Skip/Settled
reports only, stopping at drops a skip may still replace, stale skips,
written-off runs, stale miss verdicts, pending runs, and the group being
handed out.

Checkpoint of quest/m1/steady-broadcast-growth: the Nightly steady run and the
long re-profile remain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title One steady broadcast stops growing the relay and the TS passthrough fix(net): a live reader of a sparse-key track folds what it settled as it goes Nov 25, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision (/quest-run pick, 2026-11-24):

  • ✅ Measure the Nightly steady run's length: revert the fix to seed a known leak, then pick the shortest run that reliably flags it while a fixed build passes (rejected: pick a length up front).

(Written by Claude Opus 5.5)

kixelated and others added 8 commits November 25, 2026 02:39
Fold::Final folded delivered keys, which in key order include keys passed but not
handed out, so a group landing there late lost its Old report
(a_front_reports_a_late_arrival_as_a_gap). It now folds only skips and settled reports.

moq-tokio's jemalloc handler logs the exact allocated and resident bytes on each
SIGUSR1, which test/steady samples alongside VmRSS and judges with test/lib/growth.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final no longer jumps past delivered runs, so walking stretch starts with
next_told crawled key by key through a huge run (a_debt_folds_the_final_prefix,
a_huge_run_settles_in_one_step timed out). It now starts only at reports and
passes a whole report it cannot fold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wers SIGUSR1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Profiling the passthrough chain showed three readers still growing a run a group
under the reports-only Final fold:

- a front's copy, which never tells the groups it hands out: Final now passes a
  delivered key that a skip reported from the next key on proves landed;
- a reader whose drop of a group (stale under load) waits for a skip: a single
  dropped group the next skip proves produced folds too, as no skip covers it;
- a key-order read of a front, whose drop poll never reports the skips it read
  past: Ordered::read settles passed keys the publisher skipped with the group.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/growth.py

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…seeded leak

The fixed build's worst slope over 300-900 s was +9.3 B/group and the
seeded leak's mildest +73.0; RSS couldn't separate them, so it is recorded
but not judged. lite-06 still grows in the relay and export: its own quest.

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

Copy link
Copy Markdown
Collaborator Author

Applied the run-length decision on 5d9f912: I seeded the leak with main's record fold and ran both builds on lite-07 at 60 groups/s. The shortest run that keeps a twofold margin on both sides is 900 s, judged after 300 s, failing above 32 B/group of allocated heap. Over that window the fixed build's worst process grew +9.3 B/group and the leak's mildest +73.0. A 600 s run left the fixed import, still warming up, at +22.7. The table is in test/steady/README.md.

(Written by Claude Opus 5.5)

…FO before upload

From review round 1: the stall guard averaged the whole window and could
pass on the sampler's own dump I/O, so every interval after warm-up must
now move 32 KiB/s (the media moves about 130). An exited child lingers as
a zombie with no VmRSS, now reported as an exit. A kept run directory no
longer holds a FIFO for the artifact upload to block on. Docs say only
allocated heap is judged.

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

Copy link
Copy Markdown
Collaborator Author

Design change: proposed, not built, pending the maintainer's pick (listed under Waiting).

Problem, stated without the current code: a live reader's record of per-key outcomes has to stay bounded on an unending sparse-key track, without changing anything a reader delivers or reports.

The current Fold::Final proves finality key by key. Two of its proofs infer that group K landed from a Skip at K+1, and on a relay copy that inference fails, because SUBSCRIBE_SKIP arrives independently of K's stream (review findings 1 and 10). Its exclusions also leave dropped groups, readers that only receive, and lite-06 unfolded.

Recommended design: fold a key together with its group's span only when the track holds that group whole with that span. The span is the publisher's own declaration, and no group starts inside a whole span, so this is a proof rather than an inference. Consecutive groups' spans abut and merge into one run. The neighbor-Skip rules then go away. Never fold while a start is unresolved (finding 11).

The reviewer proposed the lossy Debt fold on the doubling trigger below a horizon instead. It is simpler, but in normal operation it settles keys whose verdict can still change.

(Written by Claude Opus 5.5)

…cast-growth

# Conflicts:
#	.claude/skills/verify-subscribe/SKILL.md
kixelated and others added 4 commits November 25, 2026 13:27
Fold::Final no longer infers that a skip at K+1 proves group K arrived, which
fails on a relay copy where SUBSCRIBE_SKIP arrives apart from K's stream. A
group handed out or reported dropped is final once the track holds it whole
with its declared span, and so are the drops reported inside that span.
Handed-out runs take in each whole span, misses inside one are forgotten, and
stale drops report as their own kind so no fold settles them. Nothing folds
while a publisher's start is unresolved or the reader's ranges are unplaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key-order read counts every key it passes as handed out, so the span fold
could prove none of its groups final, and a front's copy, which reports none,
kept one skip run per group: the steady export grew 37 B/group. Such a read now
also records the groups it handed out itself, which fold with their whole
spans; a key it only passed stays open for a late arrival's report. The front
test now bills the copy to the shared pool, which it never measured, and reads
each group open with its end arriving at the live edge, as the export does.

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

A reader that polls what it missed no longer takes a whole span into
`delivered` as it grows, which kept a relay from reporting a skip it had yet to
poll. Every final stretch now merges what was handed out in it, so a key-order
read of a track without spans keeps one run, while a debt forgets what a reader
gave up beside it only where it settled the stretch. The publisher holds its
record until every report taken back at resolve, since polling the track there
may fold. A front's fold reads the serving copy once rather than per key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A drop that starts inside a whole group's span named only starts there, as a
relay forwards an upstream drop while the group is still open, so it stays for
the skip the group's end implies instead of folding as settled. A final stretch
merges handed-out runs only where it holds one, so an isolated report adds none.

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

Copy link
Copy Markdown
Collaborator Author

Maintainer decision (relayed from the maintainer's /quest-run round, 2026-11-26):

  • Finding 1 (record.rs:690, coalesced drops): ✅ accept with quest review --accept (rejected: fix with a new Report variant). It needs three faults at once and costs only a gap label inside a lost group.
  • Finding 2 (record.rs:517, fill verdicts): ✅ fix as Codex recommends, forgetting misses only where the fold records replacement coverage in delivered or raises the floor, with a unit test (rejected: accept).

Then a new /quest-review round and the steady run.

(Written by Claude Opus 5.5)

kixelated and others added 2 commits November 26, 2026 10:06
…cast-growth

main (#9686) reports nothing twice: a skip no longer goes out over a drop.
Drop `Report::blocks`, and with it the reason Fold::Final kept a drop
inside a whole span for its skip: a drop now folds anywhere inside a span
the track holds whole, where no other group can land late. The test that
a skip replaces a received drop is gone with that behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A short final stretch merges what was handed out in it, but forgot what
the reader gave up beside it even where `delivered` gained no run, so a
bounded read whose fill skip already expired could stay pending after its
fills answered. Forget only where `delivered` now covers the stretch.

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

Copy link
Copy Markdown
Collaborator Author

Applied the 2026-11-26 decision (#9579 (comment)) on 2e11b6e:

The steady run passes on this head. A fresh review round raised a redesign finding and three concrete ones, so the PR stays a draft with that choice under ## Waiting.

(Written by Claude Opus 5.5)

Replace Fold::Final with structural coalescing across Rust (moq-net) and JS (@moq/net):

- Collapse Report to Final and Withdrawable (only an Ordered reader's unreturned
  stale gap stays withdrawable). Served groups, declared skips, final drops, and
  wire-final stale OLD drops all coalesce directly in Record::reported.
- Absorb declared Hole::Skip runs into Record::delivered only where they extend
  an existing run rightward (or start at 0), clipped to local cursor bounds, so
  arrival-order readers stay bounded without leaking dropped keys into delivered
  or adding disjoint runs for lagging viewers.
- Prune Misses only on ranges covered by Record::delivered once drops are polled,
  preserving uncovered fill verdicts.
- Settle handed-out keys on front copies when drops are polled and exempt
  Hole::Skip from delivered filtering in resume::Reader::poll_drop.
- Delete Fold::Final, Record::handed, Record::hold, Beside::held/next_stale,
  Spans/whole, and Logical::{ordered, reports}.
- Mirror structural coalescing in js/net and add regression and differential
  property tests on both sides.
@kixelated kixelated changed the title fix(net): a live reader of a sparse-key track folds what it settled as it goes fix(net): bound sparse-key reader records by structural coalescing Nov 26, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Iterated to structural coalescing (Approach 3) on 06350da963 (merged origin/main at dc0eb1a2f7 including #9687):

  1. Late whole group after reported drop (Codex finding 1): Hole::Drop is never inserted into Record::delivered. Only declared Hole::Skip runs are absorbed into delivered, and only where they extend an existing run rightward (or start at 0), clipped to local cursor bounds. Covered by a_late_whole_group_after_a_reported_drop_is_still_delivered and the differential property test structural_coalescing_matches_reference_model.
  2. Fill verdicts uncovered by delivered (Codex finding 2 / Opus note): Misses::forget runs only on ranges covered by Record::delivered once drops are polled (self.drops.is_some()). Covered by misses_keep_uncovered_fill_verdicts_and_prune_covered_ones.
  3. Lagging lite-07 viewer stale drops (Opus high finding 3): Report is collapsed to Final | Withdrawable (only an Ordered reader's unreturned stale gap stays Withdrawable). Wire-final stale OLD drops, served groups, final drops, and skips all coalesce directly in Record::reported, while skips alone never create runs in delivered. Covered by lagging_stale_drops_and_late_group_end_keep_a_bounded_record.
  4. Deleting Fold::Final (Opus finding 4): Removed Fold::Final, Record::handed, Record::hold, Beside::held/next_stale, Spans/whole, and Logical::{ordered, reports}, and mirrored structural coalescing in js/net.

Verified with just rs test -p moq-net --features async, just rs test -p moq-net --no-default-features, just check (11,658 Rust tests), just js check / just js test, TLC CutGroupEnd.cfg, and just test steady (900 s at 60 groups/s: import +11.8, relay -1.2, export -6.5 B/group).

(Written by Gemini 4 Neon)

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.

moq-relay and moq export ts --passthrough keep growing over 72 h on one 25 Mb/s passthrough broadcast

1 participant