Skip to content

Add WebGL atlas alternate-buffer stress test and refine the manual rendering demo - #6056

Merged
anthonykim1 merged 3 commits into
xtermjs:masterfrom
anthonykim1:anthonykim1/webgl-atlas-tui-stress-dual-coverage
Jul 19, 2026
Merged

anthonykim1 merged 3 commits into
xtermjs:masterfrom
anthonykim1:anthonykim1/webgl-atlas-tui-stress-dual-coverage

Conversation

@anthonykim1

@anthonykim1 anthonykim1 commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

Part of: #6038
Follow-up to: #6042
Follow-up to: #6043

  • Add a Chromium Playwright test that simulates TUI-style alternate-buffer redraws and generates enough unique glyphs to exercise multiple atlas pages.
  • Verify the atlas stays within the renderer's texture capacity, no rendering errors occur, and primary-buffer text and pixels remain unchanged afterward.
  • Refine the existing manual atlas stress demo by separating its controls and renaming the scrolling option to Scroll output.
  • Keep deterministic merge and eviction coverage in the existing focused regression tests.

Manual verification

npm run build
npm run esbuild
npm run esbuild-demo-client
npm run esbuild-demo-server
npm start

Open http://localhost:3000, select the WebGL demo, and click atlas stress start. Enable Scroll output to append lines instead of redrawing the same viewport.

Watch for missing glyphs, blank regions, visual corruption, or rendering stalls.

Focused automated verification

DEBUG=1 npm run test-integration-debug -- \
  --suite=addon-webgl WebglAtlasStress.test.ts --project=Chromium

This opens Chromium so the synthetic alternate-buffer workload can be observed. The result appears in the terminal, with screenshots written to:

  • out-esbuild-test/playwright/atlas-stress-reference.png
  • out-esbuild-test/playwright/atlas-stress-after.png

Also verified the full addon WebGL suites in Chromium, Firefox, and WebKit. The new stress test runs only in Chromium.


Inspirations from:

@anthonykim1 anthonykim1 self-assigned this Jul 17, 2026
@anthonykim1
anthonykim1 marked this pull request as ready for review July 17, 2026 18:38
@anthonykim1
anthonykim1 requested review from Tyriar and Copilot July 17, 2026 18:38
@anthonykim1 anthonykim1 added this to the 7.0.0 milestone Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends xterm.js’s WebGL renderer validation by adding a Chromium-only Playwright stress test that mimics TUI-like alternate-buffer redraw patterns and forces significant glyph churn, while also refining the demo’s manual “atlas stress” controls to better match the workflow being tested.

Changes:

  • Added a new Chromium-only Playwright integration test that alternates buffers, redraws synthetic TUI frames, floods unique glyphs to force multi-page atlas usage, and verifies both atlas capacity invariants and post-stress primary-buffer pixel/text stability.
  • Updated the WebGL demo’s manual atlas stress UI by separating action buttons from options and renaming the scrolling toggle to Scroll output.
Show a summary per file
File Description
demo/client/components/window/webglWindow.ts Refactors the manual atlas stress demo UI controls and renames the scrolling option to “Scroll output”.
addons/addon-webgl/test/WebglAtlasStress.test.ts Adds a Chromium-only Playwright stress test covering alternate-buffer redraws, atlas page churn, capacity checks, and pixel/text stability assertions.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Low

@anthonykim1
anthonykim1 requested a review from jerch July 17, 2026 18:43
@anthonykim1

anthonykim1 commented Jul 17, 2026 •

Copy link
Copy Markdown
Member Author
atlasStressStart.mov
Screenshot 2026-07-17 at 3 05 32 PM

@anthonykim1
anthonykim1 merged commit 699f553 into xtermjs:master Jul 19, 2026
12 checks passed
nedtwigg added a commit to diffplug/xterm.js that referenced this pull request Jul 22, 2026
Upstream 8aab310..699f553 is entirely addon-webgl atlas work:

- xtermjs#6042 replaces the consume-once ITextureAtlas.beginFrame() flag with a
  monotonic pageLayoutVersion, so every renderer sharing an atlas learns
  about a page-layout change instead of only the first one to ask.
- xtermjs#6043 adds _evictAllPages() so the atlas can't grow past the renderer's
  texture capacity, plus a defensive clamp in GlyphRenderer.render.
- xtermjs#6056 adds atlas overflow/stress/shared-garble test coverage.

The merge is textually clean; the semantic follow-up to _evictAllPages is
in the next commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants