Repository navigation
Conversation
This was referenced Jul 31, 2026
Contributor
Author
|
Closing: ~37k lines bundling several unrelated systems, stale since July. Split any surviving piece into a focused PR with a measured gain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft status
This is an in-progress stacked checkpoint for the performance architecture work. It is intentionally a draft and is not merge-ready yet; the larger architecture objective and cross-platform packaged validation are still ongoing.
Architecture and retained tranches
The architectural review and per-tranche A/B reports are under
docs/readme/andtools/benchmarks/results/.Measured startup graph
Current renderer reachability is 292 JS / 2 CSS for the main window, 77 / 2 for popout, and 33 / 1 for web. Current budget headroom is 30,048 raw bytes for Electron main, 90 for preload, 49,742 for the main renderer, 30,695 for popout, and 23,928 for web.
Latest allocation audits
advancedChunksarm reduced main renderer raw by 6,050 bytes, but recursively captured an 847,208-byte capability into every renderer entry, increasing popout by 25,372 bytes and web by 94,638 bytes.All three experiments were rejected and restored file-for-file to the accepted build. Their durable reports preserve exact manifests, hashes, closure paths, behavior gates, and limitations.
Repository intelligence
The host-owned repository seams share identical in-flight status and upstream-status reads across concurrent native, WSL, and per-connection SSH callers:
git.statusRPCsgit.statusRPCsgit.upstreamStatusRPCsThose live reads publish immutable, monotonically revisioned repository snapshots containing repository identity, status, upstream state, conflicts, a worktree-graph placeholder, and per-projection freshness. Retention is bounded to 64 repository scopes, four variants per projection, 1,000 entries and ignored paths, and 64 Ki code units.
Per-caller status cancellation remains isolated, the last live status lease owns underlying cancellation, mutation invalidation fences old generations and suppresses stale publication, provider replacement isolates relay incarnations, and settled status or upstream results are never returned from a cache. Exact Git 2.25-compatible commands and SSH RPC payloads are unchanged.
The publication audit measured approximately +0.7 µs / +1.6 KiB sampled allocation for an empty status result, +3.5 µs / +16 KiB for 100 entries, and +29 µs / +151 KiB for the 1,000-entry retention bound. Callers still receive the exact original mutable result; retained entries are separate frozen copies.
Automatic Checks queries the exact host-owned snapshot seam before falling back to its existing fresh status/upstream path: desktop IPC for locally owned worktrees and background
git.repositorySnapshotRPC for active runtime-owned worktrees. It admits only complete, current-generation, exact-branch projections; stale, failed, truncated, branch-mismatched, ambiguous-upstream, unsupported-runtime, and manual-refresh cases still execute fresh work.git.statusRPCsgit.upstreamStatusRPCsThe desktop path retains sender-scoped host-to-renderer subscriptions for both normal and
reuseLineStatsidentities.invalidatedevents advance mutation/provider fences without launching work;readyis emitted only after the requested status and configured or explicit upstream projection is admissible. Checks then performs a memory-only projection query and coalesces events around an in-flight read.SSH provider incarnation rebinding fences late old-provider events. Explicit unsubscribe, sender destruction/reload, visibility or context change, connection replacement, and handler disposal release exact listeners. Active runtime environments now resolve the exact worktree selector, native versus exact WSL identity, current SSH-provider incarnation, status identity, and optional push target through a query-only background RPC. Runtime snapshot subscriptions are now retained for automatic runtime-routed SSH Checks, as described below. The first bounded mobile consumer is retained after that section.
The subscription tranche adds 5,192 raw / 1,010 gzip bytes to Electron main and 1,019 / 177 to preload versus the prior checkpoint. All renderer entry raw sizes and JS/CSS counts remain unchanged.
Independent review corrected ambiguous embedded-upstream admission, late cross-context read completion, renderer send-failure/SSH-rebind cleanup, partial subscription cleanup when a sibling registration remains pending, project-level Windows/WSL runtime rebinding, background RPC classification, and the web preload fallback contract.
The Delete Worktree dialog is the next bounded snapshot consumer. Its warning-only dirty probe queries the exact normal and
reuseLineStatsstatus identities, admits only complete fresh status/repository/conflict siblings with matching identities, and selects the newest status projection revision. Missing or stale upstream data is intentionally irrelevant; cold, stale, failed, truncated, mismatched, unsupported, and runtime-routed reads retain the fresh fallback, while main-side deletion keeps the authoritative preflight.git.statusRPCsThe Delete Worktree tranche leaves Electron main and preload byte-identical. Renderer index changes by +63 raw / -67 gzip bytes with unchanged 292 JS / 2 CSS reachability; popout and web raw bytes and file counts are unchanged. The following runtime-query tranche leaves main, preload, index, and popout raw bytes unchanged; its explicit inert web API fallback adds 296 raw / 137 gzip bytes with unchanged reachability.
Runtime-routed Checks revision stream
Automatic runtime-routed SSH Checks now keeps its existing three-second visible fallback until the normal and
reuseLineStatsstreams represent the same live provider incarnation and a ready event drives an admissible current-context snapshot read. After that admission, idle snapshot polling stops; any incarnation mismatch, invalidation, replay, disconnect, error, visibility/context change, or malformed/inadmissible snapshot immediately fails open.reuseLineStatsfallback RPCs / owner readsIndependent review reproduced and corrected a cross-socket ordering gap where one stream could advance to provider incarnation 5 while its sibling remained at 4. The retained implementation pairs both live incarnations before admission, preserves the fail-open loop, passes 220 focused tests across 16 files plus type/lint/format/max-lines/build/budget gates, and records exact A/B evidence in
tools/benchmarks/results/phase2-runtime-checks-repository-snapshot-revision-stream-2026-07-30.md.Initial mobile diff review
The first automatic mobile diff-review load now queries the exact default
git.repositorySnapshotprojection published by mobile Source Control before falling back toits existing fresh
git.statusrequest. Admission requires complete, untruncated,current-generation status, repository-identity, and conflict siblings with one matching identity;
upstream data is ignored because this surface needs only entries, head, branch, and conflict state.
git.statusprovider/mux requestsOnly the first connected load for a client, host, and worktree context may use the projection.
Initial disconnected states preserve that opportunity; later reconnects, mutation reloads, retries,
explicit refreshes, reconciliation, PR preparation, and every later diff-review load remain fresh.
The separately bounded Source Control remount consumer is described below.
Old-runtime, disconnected, missing, malformed, stale, truncated, generation-mismatched, and
identity-mismatched projections immediately retain the existing fallback and unavailable copy.
The mobile consumer adds no Electron renderer code. The mobile RPC allowlist changes Electron main
by 0 raw / -1 gzip byte versus the prior checkpoint; preload and the complete renderer tree are
byte-identical, with unchanged 292/77/33 JS reachability for index/popout/web.
Initial mobile Source Control remount
The first connected automatic load for each mounted mobile Source Control client and default
status-identity context now queries the runtime-owned
git.repositorySnapshotprojection beforeits existing fresh
git.statusfallback. Admission additionally requires a fresh configured-upstreamprojection with non-negative integer counts, a nonempty name when upstream exists, and the exact
configured no-upstream shape. Status, repository identity, and conflicts remain complete,
untruncated, current-generation, and identity-equal; upstream shares the generation without assuming
the status identity.
git.statusprovider/mux requestsCold, rejected, malformed, stale, old-runtime, or unavailable projections pay one best-effort query
and retain the fresh selector-retrying path. Disconnected-first and StrictMode preserve/coalesce the
single opportunity; reconnects and every explicit, retry, refresh, forced, mutation, branch,
reconciliation, and PR safety load stay fresh. Render-current client, connection, identity, mount,
and generation guards suppress late commits. The parser now lives at an acyclic Source Control domain
boundary shared with diff review.
This mobile-only tranche leaves Electron main, preload, and all renderer trees byte-identical, with
the same 779-record manifest and zero missing paths, missing edges, escaping paths, or static cycles.
Workspace Space Manager snapshot reuse
After automatic Workspace Cleanup warms the existing repository owner without populating renderer
gitStatusByWorktree, Space Manager now queries the exact normal andreuseLineStatsprojections before its existing six-worker fresh-status fallback. It selects the newest admissible status revision and applies status, repository identity, conflicts, and configured-upstream evidence only while the analyzed row, branch, connection/provider incarnation, runtime target, mount, and missing-status claim remain current.git.statusworkCold, stale, malformed, truncated, identity-mismatched, old-runtime, disconnected, or ambiguous projections retain the existing fresh path. Independent review corrected two liveness boundaries before publication: a fresh fallback can finish its own identity/upstream writes after claiming the missing status entry, and a connection-only SSH provider replacement aborts the old request and schedules a new one with the replacement connection. Folder/main exclusions, explicit refreshes, active polling, mutations, Workspace Cleanup reads, and authoritative deletion preflights are unchanged.
Electron main and preload remain byte-identical. The final renderer index changes by +67 raw / -169 gzip bytes, popout by 0 raw / -47 gzip, and web by 0 raw / +5 gzip, with unchanged 292/77/33 JS reachability and unchanged CSS counts.
Source Control automatic-upstream snapshot reuse
After a settled active poll while Explorer, Checks, or an editor already keeps Git status interactive, switching to Source Control now queries the exact normal and
reuseLineStatsowner projections before the existing fresh upstream fallback. The consumer selects the newest admissible status revision and applies configured-upstream evidence only while worktree, path, branch, push target, SSH provider incarnation, runtime target, visibility, and mount remain current.git.statusworkgit.upstreamStatusworkRuntime routing changes total Git RPCs from two to three (
git.status1→1,git.upstreamStatus1→0,git.repositorySnapshot0→2) while reducing physical runtime upstream work from one to zero. Cold, stale, malformed, truncated, branch-mismatched, old-runtime, disconnected, failed, or otherwise inadmissible projections retain the fresh path; explicit refreshes, mutations, reconciliation, polling, Workspace Cleanup, review-safety reads, and deletion preflights remain unchanged.Independent review replaced literal-only A/B counters with call-instrumented measurements. The final ten-file focused suite passed 123 tests, the relevant host/routing suite passed 154 tests, and the broad renderer suite passed 1,913 tests; web/node typechecks, lint/format, max-lines, production build, budgets, and complete manifest/path/static-cycle validation passed. Electron main and preload remain byte-identical; renderer index changes by +2 raw / +10 gzip bytes, with unchanged 292/77/33 JS reachability and unchanged CSS counts.
Validation completed for this checkpoint
oxlint --deny-warningsandoxfmt --checkfor this tranche.Known unresolved risks
mainand will need conflict/review decomposition before merge.Next measured work
Measure the next bounded host-owned repository consumer or runtime transport seam, then retain it only with a concrete physical-work reduction and a narrow fallback contract. Preserve native, exact-distro WSL, SSH incarnation, runtime, folder-workspace, provider, explicit push-target, cancellation, mutation-fence, and Git 2.25 behavior. Avoid additional renderer micro-UI splits that share the promoted Lucide/
cnutility graph unless a measured allocation model first proves no popout or web regression.