fix: stash overload siblings instead of discarding them on QN collision - #1
Open
pranitpanda-affirm wants to merge 1 commit into
Open
fix: stash overload siblings instead of discarding them on QN collision#1pranitpanda-affirm wants to merge 1 commit into
pranitpanda-affirm wants to merge 1 commit into
Conversation
Interface/class methods that share a qualified_name (JDBI @sqlquery overloads, C++ overloads, Python @overload, ...) previously had every arrival but one silently destroyed by cbm_gbuf_upsert_node's same-QN tie-break. The canonical survivor is picked exactly as before (no change to CALLS-edge resolution behavior), but the loser's name, signature, and annotations are now folded into a sibling_overloads array on the surviving node's properties_json instead of vanishing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
pranitpanda-affirm
marked this pull request as ready for review
August 26, 2026 22:39
DanielDeng2024
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Interface/class methods that share a
qualified_name(JDBI@SqlQueryoverloads, C++ overloads, Python@overload, etc.) previously had every arrival but one silently destroyed bycbm_gbuf_upsert_node's same-QN tie-break —search_graph/definition lookups would report zero results for a real, present method.This is Option 1 of two considered fixes. The canonical survivor is picked using the exact same tie-break as before, so
CALLS-edge resolution (which is name-only inregistry.cand has no way to disambiguate overloads) sees no behavior change — no regression to callers-of enumeration. Instead of discarding the loser, its name, signature, line range, and annotations are folded into asibling_overloadsarray on the surviving node'sproperties_json, so overload existence is discoverable instead of silently vanishing.Option 2 (symmetric arg-count-aware call resolution, so overload fan-in actually resolves per-overload rather than just being visible) is a larger, separate follow-up — deliberately out of scope here.
Testing
Two new regression tests in
tests/test_graph_buffer.c:gbuf_upsert_overload_collision_stashes_loser— 2-way and 3-way overload collisions, verifying flattening (not nesting) of stashed siblings.gbuf_upsert_same_location_refresh_no_sibling_stash— a same-file/same-line incremental re-emit is not mistaken for an overload collision.All 52 tests in the
graph_buffersuite pass under ASan/UBSan. Applied to the locally-installed binary and smoke-tested against all 30 existing project indexes (no data loss).Checklist
git commit -s) — not yet done, flagging for follow-upmake -f Makefile.cbm test) — relevant suites (graph_buffer,store_*,mcp,pipeline) are clean; the full run has ~327 pre-existing failures in tree-sitter grammar/extraction probes, unrelated to this change and present onmainbefore itmake -f Makefile.cbm lint-ci) — not run locally (cppcheck/clang-formatunavailable in this environment); deferring to CI