Raise WebGL retention cap to 32 for multi-worktree hot sets

Reported real-world usage runs 10+ worktrees with ~2 terminals each,
so a cap of 16 evicts inside the active switching set and returns to
those worktrees pay the context rebuild the retention exists to avoid.
32 covers ~10-16 worktrees x 2 panes (~100-250MB worst-case hidden
framebuffers) while staying far under the 128 context budget.
This commit is contained in:
Jinwoo Hong
2026-07-02 15:28:25 -04:00
parent 1a55ec8c18
commit 37f70510f2
2 changed files with 9 additions and 6 deletions
+6 -4
View File
@@ -30,10 +30,12 @@ Findings (baseline, this machine):
ConPTY corruption + perf differences on degraded-mode/fresh-local spawns).
Fixes on this branch (PR #7080 merged in — WebGL release on dispose + stale pty:exit synthesis):
- A: WebGL context retention across hide/show (pane-webgl-context-retention.ts, LRU cap 16;
suspend keeps live contexts; resume repaints instead of recreating). Gated to Windows
(getRendererAppPlatform() === 'win32'): macOS/Linux context creation is cheap, so they
keep dispose-on-hide and pay no retention GPU-memory cost.
- A: WebGL context retention across hide/show (pane-webgl-context-retention.ts, LRU cap 32 —
sized for ~10-16 worktrees × ~2 terminals hot sets; suspend keeps live contexts; resume
repaints instead of recreating). Gated to Windows (getRendererAppPlatform() === 'win32'):
macOS/Linux context creation is cheap, so they keep dispose-on-hide and pay no retention
GPU-memory cost. Peer note: at least one comparable product raises the context budget to
256 and retains unbounded with a session-wide DOM latch on loss; we bound + recover instead.
- B: useConptyDll for LocalPtyProvider spawns (local-pty-utils.ts) — parity with daemon.
- D: atlas recovery bursts skip suspended panes (scoped to visible); retained panes repaint
on resume (shared-atlas invariant preserved).
@@ -5,8 +5,9 @@ import type { ManagedPaneInternal } from './pane-manager-types'
// and recreate it on return — ~5ms on macOS but 100-500ms per pane on Windows
// (ANGLE → D3D11), paid synchronously on the switch path. With the app-level
// context budget raised to 128 (#7064), hidden panes can keep their contexts;
// this LRU cap only bounds hidden-pane GPU memory.
export const RETAINED_WEBGL_PANE_CAP = 16
// this LRU cap only bounds hidden-pane GPU memory. Sized for the reported hot
// set (~10-16 worktrees × ~2 terminals) while staying far under the budget.
export const RETAINED_WEBGL_PANE_CAP = 32
/** Windows-only: context re-creation is cheap on macOS/Linux GL, so hidden
* panes there keep the long-proven dispose-on-hide behavior instead of