Repository navigation
Retry failed refs by the definition delta, not every changed name - #559
Conversation
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
|
@coderabbitai review |
|
…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.
173c917 to
d47e033
Compare
|
@coderabbitai review |
|
Summary
Instrumented
codegraph syncon 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.getNodeNamePairsByFilescovers all named nodes (imports and bindings included), sodefinitionDeltaalready captures binding swaps — a body-only edit legitimately yields an empty delta, meaning zero refs can newly resolve. Retry candidates now come fromdefinitionDelta, 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)Stacked on #558.