Skip to content

Refill Ghostty prewarm pool after consumption#187

Merged
almogdepaz merged 3 commits into
prewarm-ghostty-immediatelyfrom
post-take-ghostty-prewarm-replenishment
Jul 20, 2026
Merged

Refill Ghostty prewarm pool after consumption#187
almogdepaz merged 3 commits into
prewarm-ghostty-immediatelyfrom
post-take-ghostty-prewarm-replenishment

Conversation

@almogdepaz

@almogdepaz almogdepaz commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • schedule a deferred Ghostty prewarm refill after a prewarmed instance is consumed
  • keep take() as a pure consume operation so refill does not start wasm work in the terminal-open stack
  • preserve immediate-prewarm debug/onReady instrumentation from Prewarm Ghostty terminals immediately #186
  • clean up perf-* sessions in terminal-load-perf.ts so repeated measurements do not exhaust broker fds

Verification

  • bun run typecheck
  • bun test tests/unit/ghostty-prewarm-pool.test.ts tests/unit/ghostty-prewarm-debug.test.ts
  • bun test tests/unit/terminal-load-perf.test.ts tests/unit/ghostty-prewarm-pool.test.ts tests/unit/ghostty-prewarm-debug.test.ts
  • bunx playwright test tests/e2e/grid.e2e.ts --project=desktop
  • local server-only deploy with --broker=no
  • browser grid smoke: 2 cells hydrated/live, no console errors or failed requests
  • combined n20 perf: grid prewarm hits 40/40, grid Ghostty create p95 0.1ms, grid reveal p50/p95 197.6/218.5ms, page console errors 0, remaining perf sessions 0

Stacked on #186 (prewarm-ghostty-immediately). Retarget/rebase to main after #186 merges.

@almogdepaz

Copy link
Copy Markdown
Owner Author

reviewed the PR #187 diff.

no blocking findings.

findings:

  • low / nonblocking — public/ghostty-prewarm-pool.ts:25 and public/ghostty-prewarm-pool.ts:29: scheduleGhosttyPrewarmRefill drops the promise returned by options.prewarm() instead of routing rejection to onError. the current app call passes GhosttyPrewarmPool.prewarm(), which catches create failures internally, so this is not a merge blocker. but since the helper is exported and its API accepts an arbitrary async prewarm, a future caller can produce an unhandled rejection. i'd wrap the call once and attach .catch(onError), plus add a rejected-prewarm unit test.

nonblocking observations:

@almogdepaz

Copy link
Copy Markdown
Owner Author

addressed the low/nonblocking refill error-handling finding in 3ac4c7c.

  • scheduleGhosttyPrewarmRefill now routes async prewarm() rejections to onError
  • also catches synchronous prewarm() throws defensively
  • added regression coverage: refill scheduling reports asynchronous prewarm failures

verification:

  • bun test tests/unit/ghostty-prewarm-pool.test.ts tests/unit/ghostty-prewarm-debug.test.ts
  • bun run typecheck
  • git diff --check

@almogdepaz
almogdepaz merged commit efcd45f into prewarm-ghostty-immediately Jul 20, 2026
1 check passed
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