fix(render): bound host-paced latency - #63
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughChanges主机节奏 PTS 呈现
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了啥呀
catchUp与maxLead,但不猜测 Surface 究竟顶掉了哪帧,Rd/丢帧只记录能够确认的提交结果为啥要改
#61 已经把同步/异步解码统一到了同一个 PTS presenter,但原来的初始锚点仍主动留出完整一帧,稳定时也会平白增加约一帧延迟;decoder burst 还会把未来队列完整保留下来,积压越多延迟越高。
这轮把直出路径改成“稳态守 PTS、积压丢旧帧”:正常情况下只付 1–2 ms 的提交余量,真实抖动超过半帧预算时优先追上最新帧。它不会承诺所有设备上绝对零额外延迟,最终仍受 Surface/VSync 相位影响,但不再人为固定增加一帧。
review 时确认了一个杂鱼陷阱:在半帧预算内减去完整一帧,会让后处理目标恒定钳成当前时间,反而绕过 PTS 节奏。这段补偿已删除;在最终 Surface 能继承原始 target 之前,不提前冒充“长期方案”。
验证
npm run check:通过c++ -std=c++17 -Wall -Wextra -Werror -I nativelib/src/main/cpp nativelib/src/main/cpp/presentation_scheduler.cpp nativelib/src/test/cpp/presentation_scheduler_test.cpp -o /tmp/moonlight-presentation-scheduler-test && /tmp/moonlight-presentation-scheduler-test:通过DEVECO_SDK_HOME=/Applications/DevEco-Studio.app/Contents/sdk bash ./hvigorw assembleHar --mode module -p module=nativelib@default -p product=default --no-daemon:BUILD SUCCESSFULJAVA_HOME=/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home DEVECO_SDK_HOME=/Applications/DevEco-Studio.app/Contents/sdk bash ./hvigorw assembleApp --mode project -p product=default --no-daemon:BUILD SUCCESSFULgit diff --check:通过HDC 当前返回
[Empty],还需真机比较 host-paced 开/关的输入到光子延迟,并观察catchUp/maxLead是否符合预期。Summary by CodeRabbit