feat(render): add true two-step PTS pacing experiment - #73
Conversation
|
Warning Review limit reached
Next review available in: 20 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthrough新增 Changes两阶段呈现调度
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
nativelib/src/test/cpp/two_step_presentation_scheduler_test.cpp (1)
4-7: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value建议显式包含
<iterator>代码中多处使用
std::size(...)(如106、140行),但未包含声明该符号的<iterator>头文件,当前依赖其它头文件的传递包含。虽然当前构建可通过,但并非标准保证的可移植写法。♻️ 建议修改
`#include` <cassert> `#include` <cmath> `#include` <cstdint> +#include <iterator> `#include` <iostream>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nativelib/src/test/cpp/two_step_presentation_scheduler_test.cpp` around lines 4 - 7, 在 two_step_presentation_scheduler_test.cpp 的头文件区域显式添加 <iterator>,确保使用 std::size 的测试代码具备直接且可移植的声明来源;不要依赖其他头文件的传递包含。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@nativelib/src/main/cpp/video_decoder.cpp`:
- Around line 1062-1073: Update PresentationTargetGuard and the
presentation-target APIs so PreparePresentationFrame returns an opaque
generation/target handle, which the guard stores when preparation succeeds.
Change cleanup to discard by that handle rather than only pts_, and ensure
DiscardPresentationFrame ignores stale handles after reset, disable/re-enable,
or replacement. Preserve committed guards’ behavior and prevent an older guard
from removing a newer target with the same PTS.
---
Nitpick comments:
In `@nativelib/src/test/cpp/two_step_presentation_scheduler_test.cpp`:
- Around line 4-7: 在 two_step_presentation_scheduler_test.cpp 的头文件区域显式添加
<iterator>,确保使用 std::size 的测试代码具备直接且可移植的声明来源;不要依赖其他头文件的传递包含。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 8aca4ade-63b8-4724-aef1-2a3c5de9da85
📒 Files selected for processing (8)
nativelib/src/main/cpp/CMakeLists.txtnativelib/src/main/cpp/native_render.cppnativelib/src/main/cpp/native_render.hnativelib/src/main/cpp/presentation_scheduler.hnativelib/src/main/cpp/two_step_presentation_scheduler.cppnativelib/src/main/cpp/two_step_presentation_scheduler.hnativelib/src/main/cpp/video_decoder.cppnativelib/src/test/cpp/two_step_presentation_scheduler_test.cpp
改了啥呀
drain-to-latest,突发输出只把最新帧交给二步调度器为啥要改
#72 的后置 PTS 版本已经得到不错的用户反馈,所以它继续作为稳定基线。这次只验证真正二步是否能让解码耗时消耗已有呈现余量,并在同步解码突发时避免把一串旧帧排入 Surface,而不是再叠动态余量、额外一帧缓存或新的恢复状态机。
合成 120 Hz 场景中,平均解码后等待从约
8333 us降到6333 us。主要设备风险仍是同步drain-to-latest会主动丢弃已经过时的解码输出,需要实机 A/B 判断 120 Hz 流畅度和操作延迟是否真正改善。验证
presentation_scheduler_test:通过presentation_observability_test:通过two_step_presentation_scheduler_test(ASan/UBSan):通过node hvigorw.js assembleApp --mode project -p product=default -p buildMode=debug --no-daemon:通过git diff --check origin/master...HEAD:通过Summary by CodeRabbit
新功能
测试