Skip to content

Revert WebGL context retention from #7085 (keep ConPTY warm-up and dispose hardening) - #7169

Merged
Jinwoo-H merged 1 commit into
mainfrom
revert-pr-7085-webgl-retention-only
Jul 3, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
revert-pr-7085-webgl-retention-only

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Scoped revert of the WebGL context retention portion of #7085. Not reverted because it's believed wrong — it's the largest behavioral change in that PR and hasn't had enough real-world terminal lifecycle testing yet, so we're parking it while keeping the smaller/lower-risk wins.

Reverted (back to dispose-on-hide)

  • pane-webgl-context-retention.ts + its test file (deleted) — the Windows-only suspended-pane context retention with the LRU cap of 32
  • pane-rendering-control.ts — suspendPaneRendering disposes WebGL on every pane again; resumePaneRendering drops the retained-pane repaint branch and always goes through reattachWebglIfNeeded
  • pane-webgl-renderer.ts — removes the retention-entry cleanup hook from disposeWebgl; resetWebglTextureAtlas no longer skips suspended panes (recovery bursts touch all panes again, as before Improve Windows terminal performance: retain WebGL contexts, warm first ConPTY #7085)
  • pane-manager.ts — refreshAllPanes no longer skips suspended panes

Kept from #7085 (unchanged by this PR)

  • Active WebGL context release on dispose (WEBGL_lose_context + canvas zeroing) and disposePane routing through disposeWebgl — the [Bug]: Windows AppHangB1 when opening/activating terminal session #6874 context-budget hardening
  • ConPTY warm-up at daemon boot (windows-conpty-warmup.ts)
  • useConptyDll parity for LocalPtyProvider spawns
  • PTY kill/synthetic-exit dedup fixes, spawn-timing instrumentation, benchmark harnesses

Verification

  • Fully reverted files are byte-identical to their pre-Improve Windows terminal performance: retain WebGL contexts, warm first ConPTY #7085 state on main
  • No remaining references to the deleted retention module anywhere in src/
  • Re-adds a regression test locking in the restored behavior (disposes WebGL when rendering is suspended)
  • vitest pane-manager suite: 36 files / 324 tests pass; renderer typecheck (tsgo tc:web) and oxlint clean on touched files

Effect on Windows: worktree switches go back to paying the warm WebGL context re-create on return (the pre-#7085 behavior). The first-visit cost and ConPTY spawn improvements from #7085 are unaffected.

@Jinwoo-H
Jinwoo-H merged commit 78d3a37 into main Jul 3, 2026
4 checks passed
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e79901a4-4446-433b-962f-c9f55d26993a

📥 Commits

Reviewing files that changed from the base of the PR and between 8e8a08a and 7881b2e.

📒 Files selected for processing (8)
  • notes/windows-perf-progress.md
  • src/renderer/src/components/terminal-pane/terminal-visibility-resume.ts
  • src/renderer/src/lib/pane-manager/pane-manager.ts
  • src/renderer/src/lib/pane-manager/pane-rendering-control.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-context-retention.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-context-retention.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-refresh-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-renderer.ts

📝 Walkthrough

Walkthrough

This PR reverts previously introduced WebGL context-retention behavior for hidden/suspended terminal panes. The dedicated retention module and its test suite are deleted, along with the import and call sites that used it in pane suspend/resume/dispose logic. Suspending a pane now unconditionally disposes its WebGL resources and defers reattachment, while resuming clears state flags and reattaches WebGL without buffer-refresh special-casing. refreshAllPanes no longer skips deferred panes, and resetWebglTextureAtlas no longer early-returns for deferred-attachment panes. A comment and progress notes are updated to reflect the revert, and a new test verifies dispose-on-suspend behavior.

Changes

Area Change
pane-webgl-context-retention.ts / .test.ts Deleted retention module and its test suite entirely
pane-rendering-control.ts Removed retention import; suspend always disposes WebGL; resume always reattaches
pane-webgl-renderer.ts Removed unretain call from dispose; narrowed resetWebglTextureAtlas early-return condition
pane-manager.ts refreshAllPanes no longer skips deferred panes
pane-webgl-refresh-lifecycle.test.ts Added test for dispose-on-suspend
terminal-visibility-resume.ts Comment wording update, no behavior change
notes/windows-perf-progress.md Documented revert to dispose-on-hide behavior

Sequence Diagram(s)

sequenceDiagram
  participant PaneManager
  participant RenderingControl
  participant WebglRenderer

  PaneManager->>RenderingControl: suspendPaneRendering(panes)
  RenderingControl->>WebglRenderer: disposeWebgl(pane)
  WebglRenderer-->>RenderingControl: webglAttachmentDeferred = true

  PaneManager->>RenderingControl: resumePaneRendering(panes)
  RenderingControl->>RenderingControl: clear resume-state flags
  RenderingControl->>WebglRenderer: reattachWebglIfNeeded(pane)
Loading

Related PRs: None specified.

Suggested labels: windows, terminal, performance, revert

Suggested reviewers: None specified.

Poem
A rabbit hopped where contexts stayed,
then dug them up, the debt repaid.
Dispose on hide, reattach anew,
the buffer refresh — bid adieu.
Notes now say: "we parked that quest" —
hop on, dear pane, do your best. 🐇

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant