Repository navigation
fix(explore): the named symbols take turns in the dynamic-dispatch links list - #2751
Merged
Merged
Conversation
…nks list Links of the same rank were listed in edge order, so one named symbol's long fan-out could fill the 6-line list before another named symbol's first link. prometheus's `refresh.Discovery.refresh` hands its func field to 28 discovery packages, and in `refresh.Discovery.refresh hetzner.refresher.refresh hcloudDiscovery.refresh` those links filled the list before `refresher.refresh` → `robotDiscovery.refresh`. Each link now has a turn: how many links of its rank the named symbol it hangs from already has. Links sort by rank as before, then by turn, then by edge order, so links of the same rank alternate between the named symbols. A token that names two interfaces gets both: prometheus's `Appender.Append` matches storage.Appender and chunkenc.Appender, and storage's implementations no longer wait behind six of chunkenc's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Second follow-up from #2748, found while validating #2750.
codegraph_explore's Dynamic-dispatch links among your symbols list holds 6 lines. Links of the same rank were taken in edge order, so one named symbol's long fan-out could fill the list before another named symbol's first link.prometheus's
refresh.Discovery.refreshhands its func field to 28 discovery packages. Inrefresh.Discovery.refresh hetzner.refresher.refresh hcloudDiscovery.refresh, those 28 links filled all six lines, andrefresher.refresh → robotDiscovery.refreshwas dropped at the same rank.Main (f5dfa21):
This PR:
Change (
collectSynthLinksinsrc/mcp/tools.ts)Validation
All runs are on main f5dfa21. One index per repo; the arms differ only in
dist/mcp/tools.js.Tests:
__tests__/explore-synth-link-endpoints.test.tsWidewith 8 implementations andNarrowwith 2, named together. The six lines must alternate, Wide, Narrow, Wide, Narrow, Wide, Wide, with both Narrow implementations listed.tools.tsfails only the new case, and so does this PR with the turn key removed. The five fix(explore): every dynamic-dispatch link gets its own line, the ones the query names first #2748 cases pass in both.Sweep: gin and prometheus, main → this PR
Query shapes as in #2748 (A
X I, B/CP X I C, R random controls), plus a new shape:Nothing outside the links section changes. The list keeps its length, so the source sections are byte-identical.
The "fewer" column. The left-hand symbol is a proxy for the named symbol a link hangs from; the anchor can be on the right (
SeriesSet.Err → lazyGenericSeriesSet.Errhangs from the namedlazyGenericSeriesSet.Err). In the 3 prometheus B queries with fewer left-hand symbols:With more named anchors than slots, the last anchor in query order can still miss out.
Prometheus A/B/C also change. There the named implementation hangs other links (other interfaces it satisfies), and they now take turns with the interface's fan-out.
Appender.Appendmatches two interfaces, storage.Appender and chunkenc.Appender. On main, chunkenc's implementations filled the list for ascrapeLoopquery, which uses storage's. Now storage'stimestampTrackerandtimeLimitAppenderand the namednotReadyAppender's second interface,LimitedAppenderV1, appear.More lines whose site is a test file in prometheus A/B. 91 of the 103 added such lines come from queries that name a test double themselves, whose own links now get a turn. The rest are reshuffles inside the last tier, or a link registered in a test file with a production target. Links into tests through an unnamed end still sort after every other link.
Cost
Flow builder time, fix/main: median 0.99 (gin) and 0.96 (prometheus), with p95 1.13 / 1.09.
Suites
Full suite on this commit over main f5dfa21, on Windows, with the kernel built,
CODEGRAPH_KERNEL_EXPECT=1and--maxWorkers=4 --minWorkers=1:🤖 Generated with Claude Code