Skip to content

perf(tooling): skip unused historical blobs in line-cap checks - #173340

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-pack-producer-20260919
Oct 15, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-pack-producer-20260919

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The line-cap ratchet reads every changed file's historical source before discovering that most files already satisfy their cap. In a partial clone, git cat-file --batch still fetches absent blobs one at a time, creating one pack per unnecessary historical read.

User Impact

Checks for under-cap changes avoid historical blob downloads and their pack/index files. Existing caps, inherited allowances, staged changes, exclusions, and rename handling stay intact. No clone migration or runtime configuration change.

Why This Change Was Made

Measure current sources first. Only over-cap files need historical allowances; defer rename detection until those allowances are needed and load only their base sources. Initial changed-path enumeration uses --no-renames and still includes renamed destinations as additions.

Production delta: 10 additions / 11 deletions (net -1 line), excluding tests and docs. This deletes unnecessary reads rather than adding a cache or prefetch layer.

Evidence

Synthetic Linux benchmark of the actual script, isolated sandbox, Git 2.53, 30 changed source files in a blob:none clone, each reduced from 900 to 100 lines under a 700-line cap. Three fresh clones per version; file-protocol origin, no simulated network latency:

Metric Before After
New packs per invocation 30, 30, 30 0, 0, 0
Median elapsed time 402 ms 113 ms
Median peak RSS 85,644 KiB 83,596 KiB

Both versions returned the same successful result. That is 3.56x faster and about 2 MiB lower median peak RSS in this fixture. Expected pack creation from this eliminated under-cap baseline-read path is zero; total repository packs/day cannot be projected without invocation counts. Ordinary explicit fetches, over-cap historical reads, and arbitrary agent shell commands remain separate producers. When any file remains over-cap, existing repository-wide rename detection may still hydrate other blobs. This is not a claim that all observed pack growth came from the ratchet.

The investigation also reproduced git diff --check creating 40 packs for 20 changed files and cat-file --batch creating 20, versus zero for metadata-only diff --name-only --no-renames. Those are separate Git behaviors, not changed here.

  • Regression fails on original source because one extra pack appears; passes on the patch without adding packs.
  • pnpm test test/scripts/check-line-cap-ratchet.test.ts --maxWorkers=1: 6/6 passed, 10.22 s test time, 12.56 s runner wall time. Existing coverage exercises growth, shrinking debt, renames, staged/untracked sources, exclusions, and syntax errors.
  • Changed-file oxfmt, targeted repository oxlint, and git diff --check passed.
  • Broad validation is delegated to PR CI. No Testbox/Crabbox lease, full local suite, typecheck, or build.
  • Independent subagent review (autoreview route unavailable): scoped-clean, no actionable P0–P2 findings. The requested autoreview provider was refused because it does not match operator configuration; no configuration was changed.

Measure current sources before reading inherited allowances. Under-cap changes no longer trigger per-blob partial-clone fetches or rename detection. Preserve over-cap, staged, and rename-aware enforcement.
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 15, 2026 17:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T17:38:39.926135Z 91b15f4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XS labels Oct 15, 2026
@steipete
steipete merged commit c742bdc into main Oct 15, 2026
158 of 160 checks passed
@steipete
steipete deleted the steipete/perf-micro-pack-producer-20260919 branch October 15, 2026 17:49
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…law#173340)

Measure current sources before reading inherited allowances. Under-cap changes no longer trigger per-blob partial-clone fetches or rename detection. Preserve over-cap, staged, and rename-aware enforcement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation scripts Repository scripts size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant