Repository navigation
Persist external calls aggregated per (file, callee) in fcall_external (Part of #8529) - #8530
Merged
Merged
Conversation
…xternal Calls the resolver cannot tie to a definition in the repository (standard library, macros, third-party packages, built-ins; step 'none') were counted in fcall_rate_data but not stored, so a rename of such a name could not be scoped from a scan and caller lists were incomplete. New table fcall_external(src_file_id, callee, callers): one row per (calling file, callee name), call kind only, cascading off the calling file like fcall_data, wiped with the snapshot on a rescan. fcall_data, the confident graph and the rate table are unchanged. Measured (one snapshot each): curl 8,850 rows (fcall_data 19,158), libgit2 8,072 (41,428), prometheus 13,655 (31,195); the sum of callers equals fcall_rate_data's external count exactly in all three. Golden masters unchanged (crucible_check passes, both modes). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRveGdV73aUiuqkipAic
Contributor
4 tasks done
Contributor
|
No description provided. |
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
A scan counted its external calls (standard library, macros, third-party packages, built-ins; step
none) infcall_rate_databut stored none of them. New tablefcall_external(src_file_id, callee, callers): one row per (calling file, callee name) for every call-kind external pair,callers= the calling functions (or top-level slices) in that file that make the call. Same pattern asfcall_candidates(#8161): created idempotently, wiped with the snapshot on a rescan, cascades off the calling file, nothing reads it into PageRank, fan-in or the file graph.fcall_data, the confident graph andfcall_rate_dataare unchanged. Part of #8529.Type of change
Measured (one snapshot each, this branch's engine)
fcall_externalrowsfcall_datarowscallersfcall_rate_data.externalThe table holds exactly the calls the rate table counts, in far fewer rows than adding them to
fcall_data(which would roughly double it). A test pins the equality. Most-called externals look right: curlDEBUGASSERT,free,Curl_cfree,failf; prometheus (Go)NoError,len,Equal,append.What it is for
Scoping a rename or removal of a name the repository does not define. Check: on curl, the parent of
193cb00ce9(freetocurlx_free, 471 files touched), the scan listsfreein 168 files; the commit changedfree(calls in 161 and 157 are in both (recall 0.98, precision 0.93; misses are macro definitions). The reader is a read-only command in a follow-up PR.Class / Sibling gaps
Class: every call the resolver classes as
external(stepnone, counted infcall_rate_data.external) and previously dropped at insert, in every language: one rule inrecord_keeper, so all members are handled by this change: none left out for a language. Sibling gaps: (1) header include counts are a different mechanism (a parse of include directives, not the call resolver), tracked in #8529, not built here; (2) in Go and Python the callee string is a bare name, so same-named methods in different packages merge into one external row, the same limitfcall_dataalready has: a call-graph resolver matter, not this table's; (3)referencekind external pairs are not stored, the resolver keeps a reference only when the name is in scope for certain.CI checklist
python tests/tools/audit_check.pypassestests/tools_recorders(360 passed with the new file; 5 new tests, 4 fail without the change), tree-wide guards (289 passed, 1 skipped), time ratchet (35 tests, none near the limit)python tests/tools/crucible_check.pypasses in both modes (full precision and zero dependency); golden masters unchanged, no re-blessVerification
Files (hand-written, 3):
gitgalaxy/recorders/record_keeper.py,docs/function_call_graph.md,tests/tools_recorders/test_fcall_external.py.🤖 Generated with Claude Code
https://claude.ai/code/session_018srRveGdV73aUiuqkipAic