Repository navigation
chat: reuse measured heights for persistent progress - #342371
Merged
Justin Chen (justschen) merged 1 commit intoOct 18, 2026
Merged
Conversation
Reuse the row's measured fractional height when aligning persistent progress instead of forcing a synchronous geometry read during rendering. Preserve correction across same-height replacements and virtualization, with regression coverage for both rendering modes. Related to #340236. Matched end-to-end measurements did not establish a significant aggregate layout improvement; this is a focused measurement and alignment fix, not a resolution of the broader regression. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow change preserves resize correction and has focused regression coverage, with no unresolved defects identified.
No open issues 🎉
What changed in this PR
Reuses measured chat row heights for persistent-progress alignment, removing a synchronous layout read. This does not establish a resolution of #340236’s aggregate performance regression.
Changes:
- Cache measured heights while preserving resize-observer alignment corrections.
- Extend regression coverage across both rendering modes, same-height replacements, and virtualization.
No actionable findings remain. Clean merge-candidate CI validation remains outstanding.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/widget/chatListWidget.test.ts | Adds measurement and alignment regression coverage. |
| src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts | Reuses cached heights for progress alignment. |
Review effort: Balanced
Justin Chen (justschen)
marked this pull request as ready for review
October 18, 2026 08:31
Justin Chen (justschen)
enabled auto-merge (squash)
October 18, 2026 08:31
Ladislau Szomoru (lszomoru)
approved these changes
Oct 18, 2026
Justin Chen (justschen)
deleted the
copilot/chat-progress-layout-340236
branch
October 18, 2026 08:35
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.
Summary
Related to #340236. This is a narrowly scoped candidate, not a demonstrated resolution of the reported 20-39% aggregate layout regression.
getBoundingClientRect()after rendering has dirtied the DOM.No CSS, settings/defaults, progress text, accessibility announcements, animation cadence, dependencies, or provider behavior change.
Comparison video:
before-after.mp4
Investigation findings
The issue's numbers are real, but its baseline and suspect-commit description are inaccurate
The October 7 CI report compares release 1.127.0 against a local production build, with seven trials per scenario on Linux/x64. It is not a six-run rolling baseline.
The named suspect,
b10961b8d330f90c7077e365c4de30899fe98f43(#337201), is a single-parent test-infrastructure commit that changes only the Agent Host E2E harness and its README.Persistent progress was initially opt-in (#336087) and defaulted to Draw on September 24 (#337425). The synchronous fractional-height alignment read targeted here was added by #339944 on October 7 at 18:36 UTC, after the issue was filed at 08:10 UTC. It therefore cannot be the original introducing change. The checkout also already includes the Draw/rendering optimization in #340995.
Much of the original measured difference precedes chat submission
The benchmark's
layoutDurationMscovers the entire trace, including startup, chat opening, input, response rendering, and shutdown. Splitting the original CI artifact's retained text-only trial 6 at the renderer's first request-start mark gives:About 67% of this particular matched trace pair's increase occurred before submission. This is a diagnostic example, not a seven-trial estimate, and does not rule out startup effects from globally loaded chat styles.
Current versus candidate: end-to-end results
40 current-worktree trials + 40 candidate trials, five per variant for each of the eight reported scenarios, with the real Copilot extension and deterministic localhost mock responses.
Both variants used the same development/unbundled build on Apple M5 Pro, macOS 27.0.1, arm64, Node.js 24.22.0. The base was
1e81fc75bb564738c29771d9b17c72e708a8211c. Pre-existing unrelated worktree changes were held constant and byte-verified, but are not included in this PR. This is not a clean-main or production Linux comparison.Primary metric: whole-trace layout duration
None of these whole-run layout changes is statistically significant. The benchmark comparison exited 0 with no threshold regressions, but this is not evidence of an overall performance improvement.
The targeted
updateWorkingProgressRounding -> getBoundingClientRectstack went from 1,168 CPU samples to zero across the paired batches. Those are sampled stack occurrences, not call counts, saved milliseconds, or proof that the underlying layout work disappeared. Regression tests independently verify the specific synchronous row read changes from one to zero.Nine additional unchanged-build trials with persistent progress Off showed post-submit layout reductions of 8.0% for text-only, 5.0% for many-small-chunks, and 11.4% for tool-terminal. Whole-run changes were +8.4%, -1.8%, and -4.6%. Off changes multiple progress/tool rendering behaviors, so this is not an isolated logo benchmark or a recommendation to disable the feature.
These were sequential, not counterbalanced, batches. Medians use the existing runner's IQR handling; Welch tests use raw samples, without multiple-comparison adjustment. No heap snapshots or
gc_statswere added to timing runs. The existing benchmark was run through a local PID-scoped launch adapter with isolated profiles; that investigation-only adapter is not part of this PR.UI and correctness validation
The same real-workbench scenario ran against current and candidate code:
Captioned recordings, raw profiles, traces, and the detailed report are retained locally; they are not uploaded in this PR.
An initial UI probe sampled inside
requestAnimationFrame, before resize-observer delivery, and observed transient 0.5px intermediate offsets. Independent analysis of 77 recorded frames found identical painted text bounds. Both variants were rerun with sampling after the rendering task; the 0.05px threshold was not relaxed.Automated checks
Reused successful validation after verifying that the reviewed source and compiled renderer hashes are unchanged:
Passed — client output refreshed.
./scripts/test.sh \ --run src/vs/workbench/contrib/chat/test/browser/widget/chatListWidget.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/widget/chatListRenderer.test.ts \ --grep 'persistent|Persistent|reconcileChatItemHeight|working|Working' \ --reporter dotPassed — 322 tests. Coverage includes both rendering modes, fractional font geometry, queued/steering requests, streaming, completion, same-height progress replacement, and a deliberately stale correction verified in the first four post-reconnect frames. The unchanged-renderer red run showed the expected synchronous-read and missing-correction failures.
Passed — full client type-check.
Passed — both changed files.
Passed.
Independent reviews
Each requested model independently reviewed the scoped product/test diff and final test refinements without reading the other reviewers' output:
Opus's coverage feedback led to explicit same-row/unchanged-height/no-read assertions and a proven stale-to-corrected fractional transition after virtualization. Product code was unchanged through those refinements.
Limits and next step
maincommits did not overlap the changed files, but their combined runtime was not re-benchmarked.Next: preserve the whole-run CI metric, break it down into pre-submit and post-submit costs, and profile a matched Linux production comparison before bisecting the relevant startup/UI/style changes.