Repository navigation
feat(call-graph): fix Level-1 extraction (PS/Haskell/Shell/Solidity) and Level-2 resolution (C++/Kotlin) outliers - #8921
Conversation
|
No description provided. |
|
PR #8921 @ c7a110d: 2 failed check(s) == rosetta-audit (failure) -- real == shard 1 (1670027 LOC) (failure) -- real |
|
No description provided. |
c7a110d to
a32d7b0
Compare
|
CI shepherd: the head of this PR (a32d7b0) is not the one a maintainer labelled |
a32d7b0 to
ed06f10
Compare
|
No description provided. |
|
This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push. |
|
No description provided. |
c02e853 to
2e3ae47
Compare
|
No description provided. |
|
This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push. |
|
No description provided. |
2e3ae47 to
6818a1d
Compare
|
CI shepherd: the head of this PR (6818a1d) is not the one a maintainer labelled |
1 similar comment
|
CI shepherd: the head of this PR (6818a1d) is not the one a maintainer labelled |
|
No description provided. |
|
This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push. |
1 similar comment
|
This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push. |
|
CI shepherd: the head of this PR (abe1b63) is not the one a maintainer labelled |
|
No description provided. |
1 similar comment
|
No description provided. |
|
This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push. |
…l, Haskell, Shell, Solidity)
…90.2%->95.7% P / 39.6%->41.5% R; Kotlin 35.9%->42.5% R at 97.5% P)
|
CI shepherd: the head of this PR (6cf9bae) is not the one a maintainer labelled |
|
No description provided. |
2 similar comments
|
No description provided. |
|
No description provided. |
Summary
Fixes the remaining Level-1 callee-extraction outliers (PowerShell, Haskell, Shell, Solidity) and the two actionable Level-2 call-resolution outliers (C++ and Kotlin) in one combined golden-master-reblessed PR.
Level-1 Extraction Accuracy (
call_graph_accuracy.pyvs tree-sitter)Every measured language on
main(other than Tcl, which is on its own PR #8915) is now >90% on both precision and recall, with all 4 outliers lifted to 95.7%–98.7% precision and 96.4%–99.3% recall and zero regressions across the other 21 languages:mainbaseline)(Swift 99.7%/95.4% and Scala 99.2%/92.6% improvements from #8795 are also locked into the regenerated baseline.)
Level-2 Resolution Accuracy (
call_graph_resolution.pyvs compiler / SCIP)mainbaseline)fmtlib/fmtvs libclang 18.1.1)kotlinpoetvs scip-java 0.13.2)Root Causes & Fixes
Level-1 Extraction
gitgalaxy/core/detector.py):_call_scanswas gated onand qualifiers_seen, which skipped_drop_nested_unit_callsfor every non-qualified language (Haskell, PowerShell, Shell, Tcl, etc.). Removing that gate (while respecting_calls_out_masked_blocksand preserving empty qualifiers) eliminated 57 inner-function FPs in Haskell and 44 in PowerShell.gitgalaxy/standards/language_standards/languages/powershell.py):CALLS_OUT_COMMAND_POSITION(line-start only) with_PS_CALLS_OUTcovering commands in statement, pipeline, assignment RHS, block, and subexpression positions plus.NETinstance/static calls (.Method(...),::new(...)), while rejecting hashtable keys (key = ...)._ps_expose_subexpressions(_calls_out_pre_shield) to expose$(...)inside double-quoted strings/here-strings and blank@"..."@/@'...'@here-string literal bodies._ps_blank_non_calls(_calls_out_rewrite) to blankenum { ... }bodies and[Parameter(...)]attribute arguments.gitgalaxy/standards/language_standards/languages/shell.py):{with(?<!\$)\{so${VAR}parameter expansions are never scanned as{ cmd; }compound commands._sh_expose_subshells(_calls_out_pre_shield) to expose$(...)inside double-quoted strings (target="$(readlink "$1")").\line continuations (_SH_LINE_CONT) in_blank_shell_heredocsso continued arguments (atf_check ... \\\n cp foo bar) are not scanned as new commands.gitgalaxy/standards/language_standards/languages/solidity.py):assembly { ... }blocks (EVM opcodes are inline assembly, not Solidity calls) and blanked call options (target.call{value: v}(data)) in_blank_solidity_non_calls.gitgalaxy/standards/language_standards/languages/haskell.py,tests/tools/call_graph_accuracy.py):{ ... }record updates in Haskell'sfunc_startsok (z { f = 1 })is not misread as a nested function definition.ts_functions()(compactify [] = []+compactify items = ...) so tree-sitter compares the whole function like-for-like.Level-2 Resolution
gitgalaxy/core/call_resolver.py,gitgalaxy/galaxyscope.py,gitgalaxy/standards/language_standards/languages/cpp.py):_overloadsfor C++ free functions resolved viafile/importacross{src_path} | caller.imported(still excludingstaticinternal-linkage functions from other translation units).fileprecision jumped83.3% → 92.4%andimportprecision88.1% → 93.9%.-> long long,-> unsigned int, etc.) tocpp.py'sfunc_start.class_alias_tables_fullwith lowercaseusing/typedefalias mapping (string_view → basic_string_view,format_parse_context → basic_format_parse_context, etc.) into receiver typing (+75typedlinks at98.5%precision).gitgalaxy/core/call_resolver.py,gitgalaxy/core/detector.py):companion object(Anonymous_Class) methods to their enclosing class soCodeBlock.of(...),AnnotationSpec.builder(...),FunSpec.builder(...), etc. resolve viaqualified(13 → 78judged at100.0%precision).typedguard with_is_unique_class(avoiding nestedBuildercollisions while typing unique classes) and enabled file-scoped return-type chains (0 → 124typedlinks at96.0%precision)._kotlin_class_parentsto extract supertypes past primary constructors (class ClassName(...) : TypeName(...)), unlockingsuper.resolution (class145 → 155judged at98.7%precision).Golden Master & Baseline Updates
tests/call_graph_accuracy_baseline.json: regenerated across all 25 languages viatests/tools/call_graph_accuracy.py --regenerate.tests/call_graph_resolution_cpp_baseline.json&tests/call_graph_resolution_kotlin_baseline.json: regenerated viatests/tools/call_graph_resolution.py {cpp,kotlin} --regenerate.tests/golden_master_audit/&tests/golden_master_zero_dep_audit/: re-blessed viatests/tools/box/golden-lock.sh python3 tests/tools/crucible_check.py --update --yes. Only call-graph / dependency-network / snapshot outputs changed as expected from improved call extraction and resolution.Verification
tests/extraction/languages/test_calls_out_level1_outliers.py+test_calls_out_haskell_juxtaposition_6454.py: 135 passed (including ReDoS immunity checks).tests/extraction/languages/test_call_resolution_level2_outliers.py+test_cpp_ctor_init_span_6266.py: 20 passed.tests/tools/call_graph_resolution.py {c,typescript,javascript} --ci: OK (no regressions).tests/ruff_audit.py --ci: passed with zero new lint/format findings.mypy 2.4.1on all modified files: zero errors in modified code.