Skip to content

Fix long-session canvas compositor slowdown - #659

Merged
Anton-Horn merged 2 commits into
mainfrom
fix/long-session-pan-lag
Sep 10, 2026
Merged

Fix long-session canvas compositor slowdown#659
Anton-Horn merged 2 commits into
mainfrom
fix/long-session-pan-lag

Conversation

@Anton-Horn

@Anton-Horn Anton-Horn commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Explicitly release territory WebGL contexts when canvas workspaces unmount or GPU initialization falls back.
  • Coalesce repeated pan and zoom notifications into one territory draw per animation frame.
  • Add regression coverage for context disposal, fallback cleanup, and frame coalescing.

Diagnosis

After several hours, the affected renderer sustained roughly one CPU core while its JavaScript main thread was mostly idle. Native sampling showed Chromium's compositor thread saturated, and restarting Cate reset the slowdown.

Workspace switches remount the canvas subtree, while territory teardown previously deleted GL objects without explicitly surrendering the underlying context. Pan notifications also issued synchronous territory draws, allowing redundant GPU work to queue faster than Chromium could composite it.

Validation

  • Focused Vitest regressions: 4 passed.
  • TypeScript typecheck passed.
  • Targeted ESLint passed.
  • Production build passed.

The broader sandboxed suite completed with 3,602 passing tests. Listener and file-watcher integration groups failed because the sandbox denied binding localhost with EPERM.

@Anton-Horn
Anton-Horn enabled auto-merge (squash) September 10, 2026 19:03
@Anton-Horn
Anton-Horn merged commit 67e86c7 into main Sep 10, 2026
3 checks passed
@Anton-Horn
Anton-Horn deleted the fix/long-session-pan-lag branch September 10, 2026 19:06
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