Skip to content

Retry failed refs by the definition delta, not every changed name - #559

Merged
bompus merged 1 commit into
fork/consolidatedfrom
perf/sync-delta-retry
Oct 27, 2026
Merged

bompus merged 1 commit into
fork/consolidatedfrom
perf/sync-delta-retry

Conversation

@bompus

@bompus bompus commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

Instrumented codegraph sync on pretix put 574 ms of a 1.26 s sync in the failed-reference retry phase — it re-resolved 624 refs keyed by every name in the touched file (~294 names), though the edit added one. A reference keyed by name X resolves identically when X's repo-wide node set is unchanged, so retrying against unchanged names is pure waste.

getNodeNamePairsByFiles covers all named nodes (imports and bindings included), so definitionDelta already captures binding swaps — a body-only edit legitimately yields an empty delta, meaning zero refs can newly resolve. Retry candidates now come from definitionDelta, plus the changed files' module-reference keys and added-file handling (the cases that must still retry broadly).

Measured

Instrumented pretix-Bun sync: 1.26 s → 0.68 s (retry phase 574 → 1 ms) — the last sync loss vs upstream-Bun's ~1.13 s flips to a ~40% win. The win scales with edit locality: any edit where most names are untouched skips most retries.

Test plan

  • sync-path-reference-retry, sync-python-import-binding-retry, sync-route-module-retry, sync-rebuild-convergence — 51 tests, all pass (adds, edits, renames, deletes, package imports, route modules, synthesis refresh)
  • Full sync → rebuild convergence: graph output unchanged

Stacked on #558.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between a913e8c and d47e033.

Files selected for processing: 1
  • src/codegraph.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@bompus

bompus commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bompus
bompus changed the base branch from perf/resolve-steal-queue to fork/consolidated October 27, 2026 20:37
…ged name

A one-file sync re-resolved every previously-failed ref keyed by ANY name
the changed file carried — hundreds of pointless re-resolutions on a
settings-style file whose hundreds of names were untouched by the edit.
Key instead by the definition delta (names whose bindings actually
changed) plus the changed files' module keys: a failed ref keyed by a
name whose repo-wide node set is untouched resolves exactly as before,
so retrying it can only redo the miss. Sync→rebuild convergence tests
all pass unchanged.
@bompus
bompus force-pushed the perf/sync-delta-retry branch from 173c917 to d47e033 Compare October 27, 2026 20:38
@bompus

bompus commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bompus
bompus merged commit e28058d into fork/consolidated Oct 27, 2026
4 checks passed
@bompus
bompus deleted the perf/sync-delta-retry branch October 27, 2026 20:55
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