Skip to content

Speed up component fixture execution - #335942

Open
Dmitriy Vasyura (dmitrivMS) wants to merge 7 commits into
mainfrom
agents/improve-component-fixtures-performance
Open

Speed up component fixture execution#335942
Dmitriy Vasyura (dmitrivMS) wants to merge 7 commits into
mainfrom
agents/improve-component-fixtures-performance

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Speed up the full Component Fixtures workload without skipping checks, fixtures, or leak detection.

  • Capture allocation and timer-scheduling errors immediately, but defer expensive stack formatting and source-map expansion until diagnostics need the stack.
  • Initialize source maps once, before asynchronous fixture-render timeouts start, so cold-cache error fixtures still render successfully.
  • Distribute independent Playwright tests within files across the existing worker pool.
  • Add regression tests for lazy stack formatting, leak reporting, and preservation of original allocation/scheduling locations.

Motivation and measurements

The Component Fixtures job on #335932 took 20m17s, including 13m05s capturing screenshots and 5m44s running interaction tests. Profiling identified eager source-mapped diagnostic stack formatting as a major rendering cost.

Local before/after measurements used the same Windows checkout, Chromium version, complete fixture list, two Playwright workers, and an already-running fixture server:

Workload Before After Reduction
All 1,765 fixture screenshots 589.74s 332.82s 43.6%
All 15 interaction tests 82.79s 76.42s 7.7%
Combined 672.53s 409.24s 39.1%

Copilot AI balanced review requested due to automatic review settings September 12, 2026 07:40
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added vscode-build VS Code build process issues perf engineering VS Code - Build / issue tracking / etc. labels Sep 12, 2026
@dmitrivMS Dmitriy Vasyura (dmitrivMS) changed the title test: Speed up component fixture execution Speed up component fixture execution Sep 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The optimization preserves diagnostic locations, leak detection, and test isolation with focused regression coverage.

Review tier: Balanced
Findings: None

What changed in this PR

Optimizes component fixture execution by lazily formatting diagnostic stacks and parallelizing independent Playwright tests.

Changes:

  • Defers disposable and timer stack formatting until diagnostics access it.
  • Warms source-map support before asynchronous fixture rendering.
  • Enables parallel Playwright test execution and adds regression coverage.
File Description
test/​componentFixtures/​playwright/​playwright.config.ts Enables full test parallelism.
src/​vs/​workbench/​test/​browser/​componentFixtures/​fixtureUtils.ts Warms source maps and lazily exposes idle-task stacks.
src/​vs/​base/​test/​common/​virtualScheduling/​virtualTimeApi.ts Lazily formats virtual timer stacks.
src/​vs/​base/​test/​common/​virtualScheduling/​virtualScheduling.test.ts Tests lazy formatting and scheduling locations.
src/​vs/​base/​test/​common/​virtualScheduling/​trace.ts Allows traces to retain unformatted errors.
src/​vs/​base/​test/​common/​virtualScheduling/​recordingTimeApi.ts Lazily formats recorded timer stacks.
src/​vs/​base/​test/​common/​lifecycle.test.ts Adds disposable-tracker regression coverage.
src/​vs/​base/​common/​lifecycle.ts Defers allocation-stack formatting until leak reporting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: a8f49160 Current: fd76b2c2

Changed (4)

chat/aiCustomizations/aiCustomizationManagementEditor/ToolsTabNarrow/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/ToolsTabNarrow/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptMigration/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptMigration/Light
Before After
before after

13 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

Defer diagnostic stack formatting until leak or timer reports need it,
while retaining allocation sites and cold-start source-map initialization.
Balance independent Playwright cases across the existing worker pool.

Reduce local full-workload execution from 672.53s to 409.24s without
skipping fixtures, tests, or leak checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prevent resize and theme redraws from advancing the stopped waveform. Reset elapsed-time tracking on resume and cover reduced-motion canvas stability after resizing in both themes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added this to the 1.139.0 milestone Sep 12, 2026
Accept the four reviewed PromptMigration and ToolsTabNarrow hashes from Component Fixtures run 34681353165. Keep all Voice baselines unchanged; its reduced-motion instability is fixed separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) force-pushed the agents/improve-component-fixtures-performance branch from 3229124 to 644d741 Compare September 12, 2026 09:16
@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Fixed the Voice screenshot instability rather than accepting its animated frame.

The fixture already requests reduced motion. The bug was in the canvas animator: resize/theme redraws still advanced the waveform from elapsed wall-clock time even after the animation loop stopped. Redraws now keep the waveform still while stopped, and resuming starts with a fresh timestamp.

Validation after rebasing onto the CI-tested main revision:

  • All 45 Playwright interaction tests passed, including two new Dark/Light canvas-resize regressions that failed before the fix.
  • All six Voice variants produced identical hashes across 54 captures (three remounts, with immediate and delayed captures).
  • 69 focused lifecycle, virtual-scheduling, and Voice onboarding unit tests passed.
  • Client/Playwright type checks and changed-file hygiene passed.

Accepted only the four reviewed non-Voice hashes for PromptMigration and ToolsTabNarrow. No Voice baseline was accepted or changed.

The previous CI run also confirms the performance improvement with the full workload: 2,213 screenshots and 43 interaction tests completed without render/test errors, reducing Component Fixtures from 20m17s to 12m00s (about 41%). That run failed only on the four baseline mismatches. The new run will verify the follow-up.

Use the four CI-uploaded PromptMigration and ToolsTabNarrow images from run 34685399713. Reviewed differences are limited to 1-4 antialiasing pixels per image, with no content or layout changes and no fixture errors. Leave Voice and all other baselines unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Updated the four remaining blocking hashes from the actual Linux screenshots uploaded by CI run 34685399713.

Reviewed differences versus the previously accepted images:

  • PromptMigration/Dark: 4 pixels, maximum channel delta 1.
  • PromptMigration/Light: 3 pixels, maximum channel delta 7.
  • ToolsTabNarrow/Dark and Light: 1 antialiasing pixel each; these returned to their original baseline hashes.

No content/layout changes, no fixture errors, and no remaining Voice diff. The exact screenshotBlocksCi checker passes against the CI manifest and the staged Git blob (Linux line endings). No tolerances or checks were weakened.

The run-to-run pixel variation is still a potential source of baseline flakiness; this update matches the latest CI artifacts, but a new run must confirm the result.

Reveal the two unstable headless fixtures after asynchronous setup and virtual-time layout finish, avoiding retained intermediate paint states. Keep layout callbacks, interactive behavior, leak detection, and strict screenshot comparison unchanged.

Add exact-byte remount regression coverage for both fixtures and themes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Investigated the layout/animation path before changing comparison. No comparison tolerances or baselines are changed in this follow-up.

Both views perform initial virtualized-list sizing and scrollbar updates on animation frames. I traced all paint-relevant styles, bounds, and scroll positions for all 420 Tools and 867 PromptMigration DOM elements. Once render reported ready, those values stopped changing; the only later mutations came from Playwright temporarily hiding input carets. Waiting longer did not repair the different images.

The useful distinction was initial painting: mounting and painting intermediate layout states could leave different edge pixels even after the final DOM converged. A fresh paint from the completed layout was stable. Holding the fixture transparent during async setup also made repeated renders stable without preventing layout measurements or observer callbacks.

Added an opt-in deferPaint fixture option, enabled only for ToolsTabNarrow and PromptMigration in headless mode. It restores visibility when async rendering and virtual-time layout finish, including when rendering throws. Interactive explorer behavior is unchanged.

Validation:

  • New exact-byte remount tests failed in both PromptMigration themes before this change.
  • All four cases passed three test repetitions: 180 captures with exact byte equality and no tolerance.
  • The final full Playwright suite passed all 49 tests, including checks that the fixture is visible before capture.
  • Client/Playwright type checks and changed-file hygiene passed.

CI will now run the same strict remount regression on Linux, alongside the unchanged baseline comparison. If a canonical first-paint image differs from the old baseline, it must be reviewed from that run; another noisy hash refresh is not being assumed to solve this.

Remove the two Playwright specs as requested and restore the helper to its original private scope. Preserve the performance and fixture stabilization fixes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accept the four first-paint baseline hashes after two complete Linux CI runs of the same commit produced identical images for all 2,213 fixtures. The exact baseline checker passes against both manifests. Keep strict comparison and the requested test removals unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Cross-run verification succeeded: attempts 1 and 2 of Component Fixtures run 34691730536 rendered the exact same commit and produced identical SHA-256 hashes for all 2,213 screenshots, with zero render errors and all 43 remaining interaction tests passing.

This includes all four previously unstable ToolsTabNarrow/PromptMigration images. The job was still failing because their committed baselines predated the stabilized first paint.

Updated only those four reviewed baselines in 972cc12. The unmodified screenshotBlocksCi checker passes against both independently captured CI manifests using the committed LF-normalized baseline content. No tolerances were changed and the two requested test files remain removed.

The next CI run checks the now-aligned baselines end to end.

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) marked this pull request as ready for review September 12, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineering VS Code - Build / issue tracking / etc. perf vscode-build VS Code build process issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants