Send RTT in probe messages and tune jitter buffer#1265
Conversation
- Read RTT from QUIC session stats and include it in moq-lite-04 probe messages instead of hardcoding None. - Floor min RTT at 10ms before applying 1.25x jitter multiplier. - Downgrade late frame warnings to console.debug. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughThis pull request updates the jitter buffer configuration system across multiple layers. The demo's 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
js/watch/src/sync.ts (1)
79-87:⚠️ Potential issue | 🟠 MajorApply RTT floor before multiplier to match the stated behavior.
At Line 86, the math currently floors after scaling (
max(10, minRtt * 1.25)).
If the target behavior is “floor RTT at 10ms, then multiply,” this should bemax(10, minRtt) * 1.25.🐛 Proposed fix
- const jitter = Math.max(MIN_JITTER, this.#minRtt * 1.25) as Time.Milli; + const baselineRtt = Math.max(MIN_JITTER, this.#minRtt); + const jitter = (baselineRtt * 1.25) as Time.Milli;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@js/watch/src/sync.ts` around lines 79 - 87, The jitter calculation applies the MIN_JITTER floor after scaling; change it to floor the RTT first then apply the multiplier: when computing jitter in the block that reads this.rtt (using effect.get and updating this.#minRtt), replace the current use of Math.max(MIN_JITTER, this.#minRtt * 1.25) with Math.max(MIN_JITTER, this.#minRtt) * 1.25 (preserving the Time.Milli cast) before calling this.jitter.set.
🧹 Nitpick comments (1)
js/watch/src/sync.ts (1)
47-58: Makerttreadonly to prevent accidental signal reassignment.This property is only assigned once during initialization at line 58. Adding
readonlyprevents accidental rebinding after construction while maintaining public access.♻️ Proposed change
- rtt?: Signal<number | undefined>; + readonly rtt?: Signal<number | undefined>;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@js/watch/src/sync.ts` around lines 47 - 58, Make the instance property rtt readonly to prevent accidental reassignment after construction: update the declaration of rtt (the Signal<number | undefined> property on the class) to be readonly and leave its initialization in the constructor as-is (it is assigned from props?.rtt in constructor). Ensure the readonly modifier is only on the property declaration (rtt) so external code can still read the signal but cannot rebind the property.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@js/watch/src/sync.ts`:
- Around line 79-87: The jitter calculation applies the MIN_JITTER floor after
scaling; change it to floor the RTT first then apply the multiplier: when
computing jitter in the block that reads this.rtt (using effect.get and updating
this.#minRtt), replace the current use of Math.max(MIN_JITTER, this.#minRtt *
1.25) with Math.max(MIN_JITTER, this.#minRtt) * 1.25 (preserving the Time.Milli
cast) before calling this.jitter.set.
---
Nitpick comments:
In `@js/watch/src/sync.ts`:
- Around line 47-58: Make the instance property rtt readonly to prevent
accidental reassignment after construction: update the declaration of rtt (the
Signal<number | undefined> property on the class) to be readonly and leave its
initialization in the constructor as-is (it is assigned from props?.rtt in
constructor). Ensure the readonly modifier is only on the property declaration
(rtt) so external code can still read the signal but cannot rebind the property.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b1105b83-2187-49ac-ba64-68733e40db5b
📒 Files selected for processing (3)
demo/web/src/index.htmljs/watch/src/sync.tsrs/moq-lite/src/lite/publisher.rs
Summary
Noneconsole.debuglatency="real-time"modeTest plan
just devand verify RTT values appear in probe messages🤖 Generated with Claude Code