Skip to content

Java call resolver: calls to a sibling overload of the same name and this(...) chaining are edges, not recursion (Part of #3772) - #6424

Merged
squid-protocol merged 4 commits into
mainfrom
churn/3772-20261024T0903Z
Oct 24, 2026
Merged

squid-protocol merged 4 commits into
mainfrom
churn/3772-20261024T0903Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3772 (compiler call-graph comparison), follow-up to #6409: the not_extracted/same_name bucket (119 on gson vs scip-java).

What changed

A Java unit calling a DIFFERENT overload of its own name (fromJson(a) -> fromJson(a, b), or constructor chaining this(...)) was dropped twice like recursion: by the detector's c != self_name filter (and this in the global ignore), then by the resolver's recursion prune.

  • detector.py: for languages with calls_out_arities (Java), a bare self-name call is kept with its argument counts (the unit's own header is not counted), and a bare this( in a constructor is recorded as the unit's own name. Qualified calls (this.f(..), x.f(..)) are unchanged.
  • call_resolver.py (one condition): an overload language's bare self-name call whose counts pick only the unit itself is pruned as recursion (same as before for the final output); a count that picks another overload is an edge; an ambiguous count stays an overload row, never an edge.

Agreement before / after (java, gson vs scip-java 0.12.3)

metric before after
recall (gated) 71.5% 72.2%
resolution recall (gated) 73.3% 73.2%
confident precision (gated) 99.8% 99.8%
confident judged 5,630 5,684
Resolution recall moves -0.1 point because the denominator (resolved sites) grows with the new ambiguous same-arity rows. Baseline tests/call_graph_resolution_java_baseline.json regenerated.

Class / Sibling gaps

Class: a Java unit's bare call to a different overload of its own name dropped as recursion. Covered: bare f(..) sibling overloads and this(..) constructor chaining (tests include true same-arity recursion staying dropped, mixed self+sibling counts, this.f(..) unchanged). Sibling gaps (none needs a burned mainframe estate):

  • Receiver-qualified same-name calls (other.fromJson(..), this.f(..)) are still dropped by the same self_name filter: needs receiver typing to tell recursion from a call on another object.
  • super(...) constructor chaining targets the parent class: a different mechanism (inheritance lookup), not touched.
  • Same-arity sibling overloads (fromJson(s, Class) vs fromJson(s, Type)) stay ambiguous: needs argument-type discrimination.
  • Kotlin/Scala/Groovy have no overload choice (OVERLOAD_LANGS is java-only), so their same-name sibling calls stay dropped.

Golden

Both fixtures re-blessed via golden-lock.sh crucible_check.py --update --yes: calls_out_to gains the Java sibling-overload edges (Java/Groovy-fixture .java function rows), with small PageRank/fan-in/fan-out/brief moves from the added edges.

Gates

New test file 5 passed; calls_out / call_resolver / detector tests 1522 passed; callgraph_check --langs java PASS; pr_gates --fast 7/7; --ratchets 9/9 (0 skipped).

Cross-repo: none.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 24, 2026 09:24
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 09:28
@squid-protocol
squid-protocol merged commit e4bae0e into main Oct 24, 2026
98 checks passed
@squid-protocol
squid-protocol deleted the churn/3772-20261024T0903Z branch October 24, 2026 09:49
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant