Repository navigation
perf(server): selected-file commits probe cherry-pick and revert refs only in reftable repositories - #40334
perf(server): selected-file commits probe cherry-pick and revert refs only in reftable repositories#40334juliusmarminge wants to merge 2 commits into
Conversation
…be no operation refs Reproduces #40314: the partial-commit step runs rev-parse --symbolic-full-name for CHERRY_PICK_HEAD and REVERT_HEAD even when the repository does not use reftable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… only in reftable repositories Fixes #40314 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Every commit of selected files started two extra
git rev-parseprocesses that look for reftable-stored cherry-pick and revert refs, even in ordinary files-backend repositories where they cannot exist. That cost about 90-120 ms per partial commit on Windows. The check now runs only when the repository (or worktree) has areftabledirectory, which the existingrev-parse --git-pathcall resolves at no extra process cost. Partial commits during a cherry-pick or revert are still refused in both ref backends.Fixes #40314
Reproduction on main
Commit c1464d6 (origin/main), Windows Server 2025 pool machine, Git 2.56.1.windows.1, Defender real-time protection on. Seed:
git clone -q --localof the t3code checkout (33,228 tracked files,git rev-parse --show-ref-format= files), branchwork. A scratch vitest driver (uploaded: https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a59a29353255fb59/perf40314.test.ts) builds the real GitVcsDriverCore with a counting ChildProcessSpawner and a span-collecting Tracer. It appends to README.md, package.json and AGENTS.md, then calls driver.commit(repo, msg, '', { stage: { filePaths: ['README.md'] } }) 6 times. Result on main: GitVcsDriver.commit.operationRef ran 2 times on 6 of 6 commits, 108-142 ms per commit (median 123 ms), right after commit.mergeHead (68-125 ms). Git processes per commit: 12-13. driver.commit total: median 1,154 ms (1,118-1,388). Baseline on the same machine with the probes disabled (operationRefs set emptied, then reverted): operationRef 0 times, 10-11 git per commit, driver.commit median 845 ms (782-1,244). Not run: the reporter's full WebSocket client flow; the measurement is at the driver.commit level that runCommitStep calls. The failing test on factory/repro-40314 makes one selected-file commit in a files-backend repo and asserts no--symbolic-full-namespawn; it fails on main on Linux too, and the 4 existing refusal tests (files and reftable cherry-pick/revert) pass.Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run src/vcs/GitVcsDriverCore.test.ts -t "selected-file|cherry-pick and revert refs"(Linux, Git 2.43): 14 passed, reftable cases skipped (need Git 2.45+)vp run check:changed: format, lint, knip, graphql, typecheck (3 packages), tests (2 files, 360 passed) all passNot in this change
Who did the work
Run by the t3code factory in T3 Code.