Skip to content

cpp call graph: choose overloads by argument count (Part of #3784) - #6541

Merged
squid-shepherd[bot] merged 6 commits into
mainfrom
churn/3784-20261024T2035Z
Oct 25, 2026
Merged

squid-shepherd[bot] merged 6 commits into
mainfrom
churn/3784-20261024T2035Z

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Part of #3784 (slice 3).

C++ overloads are now chosen by the caller's argument counts, as Java's are (#3835). cpp.py sets calls_out_arities, and call_resolver.OVERLOAD_LANGS gains cpp. A count that matches several overloads or none (default argument, variadic, uncounted Type x(args) construction) leaves an ambiguous overload row, never an edge.

Class / Sibling gaps

Class: C++ calls to one of several same-named overloads of a class in one file were linked to an arbitrary one. Handled here: member and free-function overloads, constructor calls with a counted argument list. Not handled: a header declaration versus an out-of-line definition in another file are not grouped as overloads (same as Java), and Type x(args) declarator constructions record no count, so they degrade to an ambiguous row (safe direction). The C side (hiredis/libuv) has no overloads: reference run unchanged (2,163 judged, precision 100.0%, recall 25.3%, resolution recall 58.8%); its 2,789 unmapped links are the open C item.

Measured (fmt vs libclang 18.1.1, call_graph_resolution.py cpp)

before after
confident judged 2,479 2,188
precision 84.1% 92.3%
strict precision 74.9% 82.0%
wrong-overload links 220 23
recall 21.5% 20.8%
resolution recall 63.3% 60.5%

The recall dip is the trade: calls the counts cannot choose are no longer guessed. Baseline regenerated.

Golden

Re-blessed with golden-lock.sh crucible_check.py --update --yes. cpp call rows change (calls_out_to). Other languages move only in PageRank at the 1e-5 rounding step (repo-wide rank renormalisation as ambiguous cpp calls stop being edges), plus the LLM brief rollup. scope_check.py --expect cpp lists exactly those.

Cross-repo: none.
Overlap: PR #6500 (cpp.py, baseline, graph_accuracy.md) and #6510 (graph_accuracy.md) are open; whichever merges second merges main and regenerates the cpp baseline.

Tests: tests/core_engine/test_call_resolver_overload_cpp_3784.py, tests/extraction/languages/test_calls_out_cpp_arities_3784.py; pr_gates --fast 7/7.

🤖 Generated with Claude Code

Rescue fix (bd89886)

full-suite part 2/3 failed on test_calls_out_scoped_same_name_5628.py::test_direct_recursion_stays_dropped[cpp]. The sibling test_free_function_does_not_gain_an_edge_from_a_scoped_namesake[cpp] also fails locally. Both are expected under this PR: once cpp is in OVERLOAD_LANGS, its detector keeps a bare self call with its argument count, as Java does (#3772). The resolver then prunes it as recursion when the count picks the unit itself, or links it when the count picks a sibling overload. I checked this end to end: int r(int){r(n-1)} gives no edge, and r(int,int){r(n)} gives an edge to r(int). Both tests now assert the detector row per language, and that no recursion edge survives resolution in either c or cpp. No engine change. tests/extraction and tests/core_engine pass (14,992 tests), and pr_gates --fast passes 7/7.

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

Copy link
Copy Markdown
Owner Author

Waiting on an owner decision (asked privately, 2026-10-24). Nothing is needed from contributors; work resumes once it is answered.

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

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

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 25, 2026 03:58
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 25, 2026 04:01
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #6541 @ 23b74e0: 1 failed check(s)

== full-suite part 2/3 (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40160191244/job/121073906699
repro: python -m pytest -q tests/extraction/languages/test_calls_out_scoped_same_name_5628.py::test_direct_recursion_stays_dropped[cpp]
failing tests: tests/extraction/languages/test_calls_out_scoped_same_name_5628.py::test_direct_recursion_stays_dropped[cpp]
errors:
fail-on-cache-miss: false
E AssertionError: assert ['helper', 'r'] == ['helper']
tests/extraction/languages/test_calls_out_scoped_same_name_5628.py:42: AssertionError
FAILED tests/extraction/languages/test_calls_out_scoped_same_name_5628.py::test_direct_recursion_stays_dropped[cpp] - AssertionError: assert ['helper', 'r'] == ['helper']
##[error]Process completed with exit code 1.
log tail:
env:
PYTHONUTF8: 1
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
OMP_NUM_THREADS: 1
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
PYTEST_ADDOPTS: --ignore=tests/cobol_mainframe
##[endgroup]
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: test-times-part-2.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 213987
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is f56a9a2bd1ec377bce2c595a09c9472d6ad1d1a6666ecf36f3c212502d89c157
Finalizing artifact upload
Artifact test-times-part-2 successfully finalized. Artifact ID 12586209530
Artifact test-times-part-2 has been successfully uploaded! Final size is 213987 bytes. Artifact ID is 12586209530
Artifact download URL: https://github.com/squid-protocol/gitgalaxy/actions/runs/40160191244/artifacts/12586209530
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/48954e7a-06bd-4fe1-8821-d53fdbf8fc49' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 25, 2026
… the resolver prunes it (Part of #3784)

C++ joined OVERLOAD_LANGS, so like Java (#3772) its detector keeps a bare
`f(` in unit `f` with its argument count; the resolver links it only when the
count picks a sibling overload and prunes it as recursion otherwise. The two
cpp cases asserted the old detector-level drop; they now assert the detector
row per language and that no recursion edge survives resolution in either.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot removed the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 5c7d5b0 into main Oct 25, 2026
72 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/3784-20261024T2035Z branch October 25, 2026 05:26
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