Skip to content

fix(net): a lite-07 relative start settles its window before asking fills - #8197

Merged
kixelated merged 3 commits into
mainfrom
quest/m0/test-flakes-2/lite07-relative-start
Nov 8, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m0/test-flakes-2/lite07-relative-start

Conversation

@kixelated

@kixelated kixelated commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

js/net's "integration: lite-07 reports a relative start over a frameless newest group" sometimes read reader.start() as 0n instead of the publisher's 5n (quarantined with test.skip). It reproduced about 1 in 60 runs with 8 parallel copies of the integration file. Debug logging showed the publisher sent 5 and the copy declared 5. The 0 came from the reader: hooks.sourceStart called #filling(), which asks fills over the reader's window without settling it. When group 5 had already landed (received=6) but the reader had not read since, its relative anchor was still pending, so the window covered every group. That asked a fill for [0, 5), and min(5, 0) returned 0.

Approach

hooks.sourceStart settles the window first, as floor() and nextInRange() already do and as the Rust poll_start does with cursor.sync(). The test now forces the losing order: a sibling reader on the same copy reads group 5 before the reader asks start(), so the reader's window is unsettled when it asks. Without the fix the test fails 50/50; with it, it passes 200/200 under --rerun-each. The test.skip is removed and the quest is deleted.

The Rust mirror (a_relative_start_reports_the_publishers_start_over_a_frameless_newest_group) has no such ordering: poll_start syncs the cursor before reading misses.lowest() and asks no new misses, so it is unchanged.

Impact

  • Public API: none. Wire: none.

Caused by

  • moq-dev/moq#7696 - added the fill floor to sourceStart without settling the window first

Alternatives

  • Make JS #filling only read the fills already out, as Rust's misses.lowest() does, instead of asking. That is a larger behavior change than this bug needs, and settling first already gives the mirrored result.

Choices made without asking

  • Proved the fix by forcing the order in the existing test (a sibling reader) rather than adding a new test.
  • Rewrote the epic README's paragraph for this flake to record the fix, like its other fixed entries.

Follow-ups

None.

Validation

  • bun test src/integration.test.ts -t "frameless newest" --rerun-each 200: 200 pass (fails 50/50 with the track.ts change reverted)
  • quest gate just ci: pass

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, medium effort

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with medium)

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, high effort
  • Session: 01a1b833-db74-75b0-a198-8b853829e9fc, round 1
  • Head: 919b3c4
  • Base: origin/main at 181e8bb
  • Score: 9/10, The fix settles the subscriber’s window before requesting fills and adds a regression test enforcing the failing order; source review found no actionable defects, but builds and tests were not run as instructed.
  • Findings: none

Merged origin/main at ba44c18 (conflict only in quest/m0/test-flakes-2/README.md's flake notes; kept main's new entries and this PR's fix paragraph, dropped the quarantine note). The PR's diff against main is otherwise identical to the reviewed head 919b3c4, so the review above stands.

kixelated and others added 2 commits November 7, 2026 14:36
@kixelated kixelated changed the title A lite-07 relative start resolves to the publisher's start every time fix(net): a lite-07 relative start settles its window before asking fills Nov 7, 2026
@kixelated
kixelated marked this pull request as ready for review November 7, 2026 22:51
@coderabbitai

coderabbitai Bot commented Nov 7, 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 2 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f92dcf52-65bf-4c76-ba6e-3668d70715b7
Commits

Reviewing files that changed from the base of the PR and between fe00d62 and ba44c18.

Files selected for processing: 4

  • js/net/src/integration.test.ts
  • js/net/src/track.ts
  • quest/m0/test-flakes-2/README.md
  • quest/m0/test-flakes-2/lite07-relative-start.md
  • 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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • track.ts settles before the start ask — hooks.sourceStart now calls #settle() before reading the publisher's start, the cursor floor, and #filling(), mirroring Rust's poll_start (cursor.sync() before cursor.floor()/misses.lowest()). A pending relative anchor no longer leaves the window covering every group, so the fill ask can no longer drag the reported start to 0.
  • Regression test forces the losing order — the test.skip is gone, and a sibling reader consumes the frameless newest group after reader.info() so the reader's window is still pending when start() is asked; sibling.close() joins the cleanup.
  • Quest bookkeeping — the epic README paragraph records the cause and #8197, and the quest file is deleted with no dangling references.

I verified the regression independently in this run: 30/30 pass with the fix, and 20/20 fail at integration.test.ts:535 (Expected: 5n / Received: 0n) with the three added track.ts lines reverted. bun test src/track.test.ts src/resume.test.ts src/lite/tail.test.ts reports 410 pass, and tsc --noEmit in js/net is clean. The Rust mirror already syncs its cursor, so leaving it unchanged is correct.

The alternative noted in the PR body (making #filling() read-only like Rust's misses.lowest()) is the larger change; settling first lands the same mirrored result and keeps this fix minimal, so no concern there.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@kixelated kixelated left a comment

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.

Automated review by review (OpenAI)

Reviewed head 919b3c4 against base d389cfb.

No actionable findings. Settling the reader's window before asking fills prevents an unresolved relative anchor from requesting history outside its eventual range and lowering the reported start. The sibling-reader setup forces group 5 to arrive before the tested reader asks start(), rather than relying on scheduling luck. Existing start and subsequent-group assertions are preserved.

Direction: retain the settlement-before-fill ordering and the deterministic regression.

Verification limits: GitHub-only static review of the complete diff and Subscriber settlement, cursor bounds, fill requests and sourceStart paths. No Bun, CI or reproduction runs performed.

Rechecked state, full head/base and published reviews immediately before posting.

@kixelated
kixelated added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 01eed91 Nov 8, 2026
9 of 10 checks passed
@kixelated
kixelated deleted the quest/m0/test-flakes-2/lite07-relative-start branch November 8, 2026 00:46
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