Skip to content

perf: port measured git-metadata and clone-census improvements from #1577/#1580 - #1882

Merged
ScriptedAlchemy merged 2 commits into
masterfrom
perf/port-1577-1580
Sep 20, 2026
Merged

ScriptedAlchemy merged 2 commits into
masterfrom
perf/port-1577-1580

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Ports the two production perf commits from #1577 and #1580 that still apply to master, each with an #[ignore]d measurement test so a reviewer can rerun the numbers.

From #1580: git_metadata_dirs in the code-index scheduler identity resolves the git and common dirs through repository_topology instead of re-walking the repository. measure_git_metadata_fingerprint_capture (2000 timed iterations on a one-ref fixture) reads 127.9 µs per capture before and 27.7 µs after.

From #1577: the clone-index census in the query crate no longer decodes every occurrence payload. measure_read_clone_index_census over 98,304 occurrences across 128 payloads reads 2.282 s before and 0.310 s after. census_refuses_an_occurrence_whose_payload_row_is_absent pins the undercount the old path produced (one source body reported for two stored occurrences).

Not ported: the event-driven wait in wait_for_production_composition_code_index from #1580 (only measurable through a 165 s journey suite, left for its own PR) and the hand-written Deserialize from #1577 (157 lines of byte-compatibility maintenance for a claimed 17% on one decode step that the census port already removes from its hottest path). The third shared commit on those branches, seating text through retryable graph activation, is #1877.

🤖 Generated with Claude Code

ScriptedAlchemy and others added 2 commits September 20, 2026 04:18
`GitMetadataFingerprintV1::capture` is the tier-1 staleness signal sampled on
every query admission, and this module's own contract calls that cost fixed
and cheap. Resolving the git-dir and common-dir through a fresh `gix::open`
dominated it, while runtime-core already owns a revalidating topology memo
that answers the same question.

The memo is asked only for a checkout carrying `<root>/.git`, which is both
where an open at exactly this root resolves through and where a discovery
started at this root stops, so it returns the same two paths. A bare
repository's control directory, or a path that is not a checkout root, still
opens directly, because discovery would walk past it to an ancestor whose git
metadata does not describe this project. The fingerprint samples file
metadata and contents, so its value and its persisted signature are
unchanged.

Measured by the ignored `measure_git_metadata_fingerprint_capture` test added
here, one-ref fixture repository, 2000 warm iterations after a 100-iteration
warmup: 127.9us per capture before, 27.7us after.

Ports e4290b0 from #1580, where the same change measured 75.2us to 10.0us
on different hardware.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`clone_body_payloads` is keyed by payload digest, so one row backs every
occurrence that shares that body. The census joined the two tables and
re-derived a payload's four canonical digests once per occurrence, so a
corpus of 128 distinct payloads verified those 128 payloads 98,304 times,
inside a status read that holds the scheduler lock.

Validate the payload table once, retain only the rename coverages the
per-occurrence counters distinguish, and classify occurrences against that
verified index. Both prior refusals are kept and two are added: a payload
whose blob disagrees with its stored digest, and an occurrence whose payload
row is absent. The inner join used to drop that second case from the totals
without saying so, reporting a healthy census over fewer bodies than the
artifact holds, which is worse than a refusal because nothing downstream can
tell the count is short. The new
`census_refuses_an_occurrence_whose_payload_row_is_absent` test pins it, and
fails against the previous census with `source_bodies: 1` for two stored
occurrences.

Measured by the ignored `measure_read_clone_index_census` test added here,
98,304 occurrences over 128 payloads: 2.282s before, 0.310s after.

Ports ea06d59 from #1577.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c18b3e6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-20T04:31:01.307496Z c18b3e6 PR opened
ℹ️ 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.

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