Repository navigation
Perf: deterministic mobile interaction harness + UI-thread jank fixes (home/detail/chat) - #21323
Conversation
…p90 22.7→15.5 ms) Co-authored-by: Cursor <[email protected]>
…9.8→29.0 ms) Co-authored-by: Cursor <[email protected]>
Placeholder replies share id 0000, so loading older history mapped both mounted failed rows onto one sliver index and dropped a Try Again surface. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7949fc726a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| final phase = SchedulerBinding.instance.schedulerPhase; | ||
| if (phase == SchedulerPhase.persistentCallbacks || phase == SchedulerPhase.midFrameMicrotasks) return; |
There was a problem hiding this comment.
Defer highlight rebuilds instead of dropping them
During a paused transcript fling, ballistic ScrollUpdateNotifications call readerMovedTo while the scheduler is in persistentCallbacks. This branch updates _current but never dirties the line, while _PlaybackFollowScope intentionally skips rebuilding when following is suspended; subsequent notifications are then deduplicated against the already-updated _current. Consequently, the pre-fling line can remain visually highlighted and the settled top line remains unhighlighted until an unrelated parent rebuild. Schedule a post-frame rebuild for this phase rather than returning.
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Deterministic mobile interaction performance harness + two verified UI-thread jank fixes + one blocker fix the harness/review loop caught.
What
app/integration_test/perf/+ driverapp/tool/perf_harness.sh: four seeded scenarios (home_scroll,detail_scroll,memory_scroll,chat_tap) running the real production pages/providers against the hermetic loopback fixture backend. Produces a JSON scorecard per scenario: FrameTiming p50/p90/p95/p99 (build/raster/total), jank %, top app rebuilders with source files, ticker census, build-bound vs raster-bound janky-frame split. A budget gate group asserts per-scenario p90 againstbudgets.json; budgets only move with accepted, verified wins. Lane: host flutter-tester (UI-thread visibility; GPU raster not measured — documented in the README).0000; the new row-relocation callback resolved by id lookup, so two mounted failed replies collided in the sliver relocation map on older-history prepend, corrupting/dropping a failed-reply row and its Try Again surface. Rows are now keyed by id (persisted) /ObjectKey(message)(placeholders); relocation, shouldRebuild, and visibility tracking share one identity. Regression testchat_duplicate_failed_reply_test.dartverified RED on the parent commit, GREEN here.Measurement (median p90 total-frame ms, host lane, same-session controls)
Remaining chat residual is the send/navigation frame; home/detail sit at the ~60 fps line on this lane. Accepted via median-of-N improvements ≥10% with no sibling-scenario regression >5%; rejected candidates were restored (log retained out of tree).
Failure-Class
Failure-Class: new
Duplicate placeholder reply identity colliding in sliver child relocation (indexOf-by-id when ids are non-unique).
UI-Evidence
UI-Evidence: none -- behavior-neutral performance work; no visual or interaction changes
Line-Count-Exception
Line-Count-Exception: app/lib/widgets/transcript.dart | 1516 -> 1619 | perf rework inside the frozen widget: playback-highlight follow scope + per-line notifier extracted in place; split was rejected to keep the reviewed diff bytes identical to the CLEAN-reviewed commit
Test plan
bash app/tool/perf_harness.sh— gate group + scorecard emission greenbash integration_test/journeys/run_journeys.sh— 6/6 journeys incl. negativescd app && bash test.sh— 5,325 passed, 21 skippedflutter analyzeclean on all changed fileschat_duplicate_failed_reply_test.dartfails on parent59bc23eb11(relocation assertion), passes on this head