Skip to content

perf(persistence): skip redundant whole-state flushes on terminal reattach - #20137

Merged
Jinwoo-H merged 14 commits into
mainfrom
debug-orca-performance
Sep 14, 2026
Merged

Jinwoo-H merged 14 commits into
mainfrom
debug-orca-performance

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​747 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​738
Prod 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1183 $\color{#cf222e}{\Huge{\mathbf{−}}}$​207 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​976

Reattaching a terminal can clone its workspace session and synchronously serialize the whole application state even when the same binding is already on disk. This PR skips that work when tab/leaf membership, PTY identity, incarnation, and whole-state durability already match.

The fast path runs after existing refusal checks and is disabled after final persistence starts. Changed or unpersisted bindings retain the clone, flush, and rollback path. Main's split-tab fallback PTY rule now matches the renderer, preventing sibling reattachments from repeatedly rewriting it. Sync hash-match flushes correctly advance durability bookkeeping; forced writes remain forced during asynchronous write races.

There is no per-pane durability cache. An unrelated dirty write conservatively makes the next binding flush; later unchanged bindings can skip once the whole state is durable. This keeps the optimization independent of cache receipts, session identity invalidation, and eviction. Sampled binding outcome/origin diagnostics and reusable lag probes remain. No new terminal registry or remote wire protocol is introduced. Investigation Markdown/HTML and temporary benchmark probes are excluded from the diff.

Measurements

Correction (September 13): the earlier 32-switch Electron cache A/B timings have been withdrawn. The test read the first ElectronApplication.evaluate argument as the supplied value, but that argument is the Electron module. As a result both variants retained the cache, and requested large-state padding was not installed. The run did observe session replacement invalidate receipts across 24 reattachments, but does not establish the cache's incremental performance benefit. The prior table is removed to prevent reuse of invalid timing claims.

The separate real-Store microbenchmark demonstrated a narrow cache benefit (20–23 ms around 9 MB) when unrelated state changes without replacing the session. Removing the cache deliberately gives up that benefit for simpler durability evidence. A valid app-level with/without-cache performance comparison remains unproven. The final cache-removal implementation passed separate persistence and restart/reveal checks described below.

Historical measurements motivating the overall PR: four unchanged reattachments on a roughly 9 MB profile took 59–100 ms each, including 48–84 ms in synchronous flush. These are historical baseline measurements, not a fresh before/after comparison of this final PR against main.

Validation

  • Astra medium source review: removed the repository-wide writer-count scanner/allowlist and redundant reconciliation miss. Existing refusal and mutation checks remain. Follow-up: 50 affected tests, node typecheck, lint, and formatting passed.

  • Broad local persistence/binding run: 93 files passed, 1,002 tests passed; one opt-in test skipped. Covered persistence failure/rollback and ordering, quit handling, refusals, incarnations, pane claims/materialization, and local/SSH/runtime binding partitions.

  • After extending the dirty-state regression to all three host partitions: scheduling and lag-probe follow-up 38 tests passed. Asserts the first dirty-state reattachment flushes, subsequent unchanged reattachment skips, and the dirty repo is actually on disk.

  • Rebuilt the final app without temporary instrumentation: 9 Electron E2E tests passed, including eight additional single/split warm/parked reveals, clean-restart input, stalled-daemon input recovery, replacement-daemon input, scrollback/cursor restoration, tab/worktree restore, titles, and idle-save frequency. Inspected the full hidden-renderer screenshot with both split shell panes restored.

  • Full pnpm tc, targeted oxlint, formatting, and diff checks passed.

  • Previous pushed head completed all applicable CI successfully; this simplification requires its own fresh CI result.

Reliability scope

Skipping persistence must not acknowledge changed/undurable bindings, bypass refusals, or let split siblings steal another pane's tab fallback.

The simplification changes only local persistence eligibility and removes cache state. Remote messages, field ownership, execution routing, and liveness policy are unchanged. Host-partition contracts are tested; live paired-server mixed-version journeys and Windows/WSL/folder performance were not measured in this local run. Broader ownership/migration assurance remains a separate workstream.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds live lag diagnostic scripts and probes for renderer, inspector, persistence, and terminal-render behavior. It also refactors PTY binding persistence to support refusal fences, durable fast-lane checks, rollback, generation tracking, origin metadata, and tracing. Tests cover diagnostic failures, persistence eligibility, durability, ownership, writer boundaries, tracing, and origin propagation.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 7ba70

The persistence behavior is covered by substantial tests, but the writer-boundary guard can miss files when a source subtree is unreadable, and a few persistence metrics and design-document inconsistencies remain open. These are bounded concerns that should be addressed or accepted before merge.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 31 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ⚠️ Warning The required Linked Issue section contains only Fixes # and does not identify an issue. Add the complete linked issue reference in the Fixes # section.
Description check ⚠️ Warning The description explains the implementation, motivation, testing, measurements, and reliability scope, but it omits most required template sections, including the Linked Issue, Visual Proof, AI Disclo… Add the required template headings and complete each section. Include a real issue reference after “Fixes #”, or explain the applicable issue link. Add N/A with a reason under Visual Proof if there is no UI or interaction change. Complete…
✅ Passed checks (2 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The diagnostic scripts, persistence changes, ownership updates, and tests are covered by the stated objectives and description. No clearly unrelated change is identified.
Title check ✅ Passed The title clearly identifies the main change: skipping redundant whole-state flushes during terminal reattachment.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 31 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description explains the implementation, motivation, testing, measurements, and reliability scope, but it omits most required template sections, including the Linked Issue, Visual Proof, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.

Resolution

Add the required template headings and complete each section. Include a real issue reference after “Fixes #”, or explain the applicable issue link. Add N/A with a reason under Visual Proof if there is no UI or interaction change. Complete the Testing checkboxes and list tested platforms. Complete the AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (1)
config/scripts/terminal-render-phase-probe.mjs (1)

63-69: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy lift

Reduce repeated parsing in terminal.write.

Large reattach and relay writes can reach 100 KB or more. The synchronous matchAll and four full-string replace passes can then add material latency to the measured write. Hoisting TextDecoder alone does not provide a consistent improvement. Replace the repeated scans with one pass that preserves the current CSI and OSC handling.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 21a4e697-37fa-4ef3-99d0-2c52be3fff90

📥 Commits

Reviewing files that changed from the base of the PR and between cd9aa43 and 5002758.

📒 Files selected for processing (34)
  • config/scripts/capture-live-input-lag.mjs
  • config/scripts/capture-running-orca-lag.mjs
  • config/scripts/main-blocking-probe.mjs
  • config/scripts/orca-main-inspector-connection.mjs
  • config/scripts/persistence-call-probe.mjs
  • config/scripts/terminal-render-phase-probe.mjs
  • orca-live-lag-investigation.md
  • orca-persistence-design-assessment.md
  • orca-persistence-design-visual.html
  • src/main/ipc/pty-daemon-spawn-session-identity.test.ts
  • src/main/ipc/pty-pane-claim-arbitration.test.ts
  • src/main/ipc/pty-pane-materialization-race.test.ts
  • src/main/ipc/pty-pane-reservation-settlement.test.ts
  • src/main/ipc/pty-runtime-ssh-binding-persistence.test.ts
  • src/main/ipc/pty/ipc/spawn-commit-persist.ts
  • src/main/ipc/pty/pane/stable-owner.ts
  • src/main/ipc/pty/runtime/spawn-commit.ts
  • src/main/persistence-flush-and-save-scheduling.test.ts
  • src/main/persistence/loading-store/__fixtures__/terminal-binding-writer-allowlist.txt
  • src/main/persistence/loading-store/primary-state-writes.ts
  • src/main/persistence/loading-store/pty-binding-durability-records.test.ts
  • src/main/persistence/loading-store/pty-binding-durability-records.ts
  • src/main/persistence/loading-store/pty-binding-fast-lane.test.ts
  • src/main/persistence/loading-store/pty-binding-fast-lane.ts
  • src/main/persistence/loading-store/pty-binding-persistence.ts
  • src/main/persistence/loading-store/pty-binding-refusals.ts
  • src/main/persistence/loading-store/pty-binding-span.test.ts
  • src/main/persistence/loading-store/pty-binding-span.ts
  • src/main/persistence/loading-store/store-runtime-state.ts
  • src/main/persistence/loading-store/terminal-binding-writer-boundary.test.ts
  • src/main/persistence/loading-store/terminal-tab-pty-ownership.test.ts
  • src/main/persistence/loading-store/terminal-tab-pty-ownership.ts
  • src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts
  • src/main/ssh/ssh-relay-session.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread config/scripts/main-blocking-probe.mjs Resolved
Comment thread src/main/ipc/pty/pane/stable-owner.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The tab-row ownership rule added in terminal-tab-pty-ownership.ts does not actually match the renderer's rule, so the fast lane still never converges for a tab whose row names a dead PTY — details inline.

Reviewed changes

  • Fast-lane predicate (pty-binding-fast-lane.ts) — eleven named misses gate an early return in persistPtyBinding that skips the session clone and whole-state flush when the binding already matches memory and disk.
  • Refusal extraction (pty-binding-refusals.ts) — the four pre-existing refusal fences moved verbatim and run before the predicate, preserving every existing false.
  • Tab-row ownership (terminal-tab-pty-ownership.ts) — main stops overwriting a split tab's row when a sibling pane binds.
  • Per-pane durability records (pty-binding-durability-records.ts) — replaces the too-coarse global generation comparison, paired with the writeToDiskSync hash-match counter fix.
  • Span + origin tagging (pty-binding-span.ts) — one persistence.pty-binding span per call with a 200/window fast-lane budget; the spawn-commit and relay callers tag origin.
  • Diagnostics — five inspector probe scripts under config/scripts/ and two design docs.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • Tab-row ownership (terminal-tab-pty-ownership.ts) — dropped the reclaim branch so main now rewrites the row only on null or replacement, matching the renderer's updateTabPtyId exactly; the design doc and ownership test were updated to the corrected rule.
  • Reattach origin classification (pty-binding-span.ts, spawn-commit-persist.ts, stable-owner.ts) — an adopted relay session now tags origin: 'reattach' even without an isReattach flag, with a new test asserting the label.
  • Probe robustness (main-blocking-probe.mjs, orca-main-inspector-connection.mjs) — socket closure now rejects outstanding and subsequent inspector requests, and IPC polls record failures, covered by lag-probe-failures.test.mjs.
  • Test cleanup (persistence-flush-and-save-scheduling.test.ts) — added a shared afterEach reset for the span sampler, dropping a now-redundant inline mockRestore.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b5f65f82-6678-4b52-b2df-de920eaca153

📥 Commits

Reviewing files that changed from the base of the PR and between 5002758 and 4026b47.

📒 Files selected for processing (11)
  • config/scripts/lag-probe-failures.test.mjs
  • config/scripts/main-blocking-probe.mjs
  • config/scripts/orca-main-inspector-connection.mjs
  • docs/reference/orca-live-lag-investigation.md
  • docs/reference/orca-persistence-design-assessment.md
  • docs/reference/orca-persistence-design-visual.html
  • src/main/ipc/pty-runtime-ssh-binding-persistence.test.ts
  • src/main/persistence-flush-and-save-scheduling.test.ts
  • src/main/persistence/loading-store/pty-binding-span.ts
  • src/main/persistence/loading-store/terminal-tab-pty-ownership.test.ts
  • src/main/persistence/loading-store/terminal-tab-pty-ownership.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • config/scripts/main-blocking-probe.mjs
  • src/main/persistence/loading-store/terminal-tab-pty-ownership.ts
  • config/scripts/orca-main-inspector-connection.mjs
  • src/main/persistence-flush-and-save-scheduling.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes

  • Investigation artifacts removed — 3182bf7 deletes the three investigation/design docs (orca-live-lag-investigation.md, orca-persistence-design-assessment.md, orca-persistence-design-visual.html) and repoints the ratchet-test and allowlist references off the deleted design doc. No code path changes; the fast lane, durability records, and tab-row ownership are untouched by this delta.

ℹ️ Nitpicks

  • The PR description's Docs section still lists orca-persistence-design-assessment.md and orca-live-lag-investigation.md, and the Safety section cites "the design doc's writer table" — all deleted by this commit. Worth editing the PR body so the merged record does not point at non-existent files.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)
src/main/persistence/loading-store/terminal-binding-writer-boundary.test.ts (1)

41-79: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fail the scan when a source directory cannot be read.

collectSourceFiles returns an empty list for a readdirSync failure. A nested failure can omit an entire subtree while the > 500 assertion still passes. The ratchet can then miss a terminal-binding writer. Fail with the directory path instead of treating the unreadable subtree as empty.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: d50c9015-46b9-4720-98ff-b5fafc2ceef5

📥 Commits

Reviewing files that changed from the base of the PR and between 3182bf7 and 7ba705d.

📒 Files selected for processing (3)
  • config/scripts/lag-probe-failures.test.mjs
  • src/main/persistence/loading-store/__fixtures__/terminal-binding-writer-allowlist.txt
  • src/main/persistence/loading-store/terminal-binding-writer-boundary.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/persistence/loading-store/fixtures/terminal-binding-writer-allowlist.txt

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • Lag-probe test runner — config/scripts/lag-probe-failures.test.mjs now imports test from vitest instead of node:test, so the repo's Vitest suite (config/vitest.config.ts includes config/scripts/**/*.test.mjs) actually discovers and runs both probes. Verified locally: 2 tests pass, and no workflow invokes node --test on this file, so no runner is orphaned.
  • Writer-boundary comments — the ratchet's JSDoc, failure message, and terminal-binding-writer-allowlist.txt header no longer point at the deleted "persistence writer audit"; they now describe the scanner as a syntax-only tripwire and name persistence-flush-and-save-scheduling.test.ts for behavioral durability coverage. This retires the prior review's dangling-reference nit.

Pullfrog  | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — one minor doc nit inline.

Reviewed changes

  • Global durability check replaces per-pane receipts — persistPtyBinding's fast lane now requires only !quitFlushStarted && lastDurableWriteGeneration >= writeGeneration; pty-binding-durability-records.ts/.test.ts and the StoreRuntimeState map are deleted. Strictly more conservative (fewer skips, never less safe), and no dangling references remain.
  • Dirty-state regression retargeted — the fast-lane test now asserts the first reattachment after unrelated dirt flushes once and lands the dirty repo on disk, then later unchanged reattachments skip, across local/SSH/runtime partitions.
  • Hash-match durability retained — writeToDiskSync still advances lastDurableWriteGeneration on the unforced hash-match return, which the global-only check depends on.

Verified locally: persistence-flush-and-save-scheduling.test.ts + pty-binding-fast-lane.test.ts → 40 passed.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Comment on lines +7 to +9
* Why a reattach can be ineligible. `not_durable` alone means memory already matched but the
* binding was still waiting in the debounced save — the bucket that says whether skipping the
* flush on a durable match is enough, or the autosave itself has to move off the main thread.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With the fast lane back on the global durability check, not_durable also fires when unrelated state is unpersisted while the binding itself is unchanged and already on disk — so "the binding was still waiting in the debounced save" no longer describes what the miss means. Worth widening the comment to the state, since this bucket is read to reason about flush-vs-autosave cost.

Suggested change
* Why a reattach can be ineligible. `not_durable` alone means memory already matched but the
* binding was still waiting in the debounced save — the bucket that says whether skipping the
* flush on a durable match is enough, or the autosave itself has to move off the main thread.
* Why a reattach can be ineligible. `not_durable` alone means memory already matched but the
* state holding the binding still had unflushed mutations — the bucket that says whether
* skipping the flush on a durable match is enough, or the autosave itself has to move off the
* main thread.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • reconciled fast-lane miss removed — the predicate dropped its expectedBinding cross-check; it is unreachable while eligible, because the expectedBinding refusal already forces memory to equal expectedBinding.incarnationId and the incarnation miss forces memory to equal args.incarnationId, so any real mismatch still falls through to the write path.
  • Writer-boundary scanner deleted — terminal-binding-writer-boundary.test.ts and its allowlist fixture are removed; both were added by this PR, so the net effect against main is zero, and the behavioral durability coverage they named (persistence-flush-and-save-scheduling.test.ts) is untouched.
  • Fast-lane test trimmed — the reconciled-incarnation case was removed from pty-binding-fast-lane.test.ts; the matching-incarnation happy path is still covered, and persistence-flush-and-save-scheduling.test.ts still exercises the reconciled fence bump end to end.

Verified locally: pty-binding-fast-lane.test.ts + persistence-flush-and-save-scheduling.test.ts → 40 passed.

Approval is withheld only because the prior not_durable JSDoc nit on pty-binding-fast-lane.ts:7-9 remains open and is unchanged by this delta; that thread is the only outstanding item.

Pullfrog  | Fix it ➔ | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

AmethystLiang and others added 13 commits September 13, 2026 17:37
Terminal pane reattachment currently clones the session and serializes the
entire 9.2 MB app state even when the binding is already in place and durable.
Add an early-return fast path that skips this work when all nine predicates
hold: no split, binding matches in-memory and on-disk, incarnation matches,
no tombstone, and generation counter proves durability.

Includes one-line fix in `writeToDiskSync` to record hash-matched sync flushes
as durable, so the fast path doesn't stay parked behind a stale generation.

Adds `persistence.pty-binding` observability spans (local NDJSON, unsampled for
mutations, budgeted for fast-lane hits) to measure eligibility rates before
and after. Includes ratchet test to ensure every binding writer bumps the
generation. Diagnostic tools and full investigation notes from September 7,
2026 capture that identified the 59–100 ms no-op binds and measured a real
terminal keystroke queued 117 ms behind one such call.
Rapid rebinds of already-durable PTY bindings (e.g., remounting panes)
were unnecessarily expensive because they cloned and flushed the entire
document state every time. Detect when a binding hasn't changed since the
last durable write and skip to return immediately, eliminating main-thread
cost on that path.
Fresh spawns always flush, so a fast-lane rate over all calls is diluted
by however many terminals the user opened. Each caller knows whether it
is a spawn, a reattach, a split, or a relay reattach; pass that through
as metadata and record it so the reattach hit rate can be read from the
trace file. Never branched on.
…ane binds

A tab row names one PTY, but a split tab holds several panes. The
renderer keeps the row on the first pane and refuses to let later
split-pane spawns steal it, since a remount reattaches the tab to
whatever the row says. Main overwrote it with whichever pane was binding,
and the renderer's next publish put it back, so every sibling reattach
was a state change and could never take the fast lane. On the real
profile that is 38% of panes.

Rewrite the row only when it names nothing useful: null, the PTY this
leaf is replacing, or a PTY no leaf holds. The fast-lane predicate
compares against the same rule.
The global write generation is held back by any unrelated dirty
state, causing bindings unchanged for minutes to appear unpersisted
despite being on disk. Track per-pane durability to skip redundant
flushes.
The durability section still described the global generation check as the
whole story and claimed there was no binding durability cache. Record the
measurement that motivated the per-pane record, and why retiring one needs
no cooperation from other binding writers.
…e register

Folds the findings from all related debug sessions into the live lag
investigation: the persistence/main-thread work (P1-P11), host contention
(H1-H5), git and subprocess load on main (G1-G8), renderer and terminal
rendering (R1-R8), the terminal daemon session leak from the deleted
debug-orca-perf-issue worktree (D1-D9), and the Cmd-J palette review (C1-C6).

Keeps the measurement behind each claim, records what is fixed versus open,
and restates what the 117 ms keystroke delay still does not explain.
@Jinwoo-H
Jinwoo-H force-pushed the debug-orca-performance branch from 47b6a12 to bf3bf15 Compare September 13, 2026 21:38
@Jinwoo-H
Jinwoo-H merged commit d2d3269 into main Sep 14, 2026
33 checks 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.

2 participants