Repository navigation
C call graph: a function-like macro's #if variants call the union of their callees (Part of #7828) - #8377
Conversation
…their callees (Part of #7828) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…iant macro union (Part of #7828) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
1 similar comment
|
No description provided. |
|
PR #8377 @ 1212ec0: 1 failed check(s) == call-graph-accuracy-audit (failure) -- real |
…lls something (Part of #7828) A variant that calls nothing (linuxdoom's `#define SHORT(x) (x)` beside the SwapSHORT one) means the call exists only under a configuration the compiler may not build, so libclang rejected the union edges (call-graph-accuracy-audit, callgraph job). Such a macro stays ambiguous, as before. Goldens, DOOM-rosetta goldens and the C baseline re-blessed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…on (Part of #7828) Against main's engine on nugget-doom and woof the union adds ~128 clang-confirmed edges (recall .985 -> .998) and no new clean-file disagreement; the extra engine-only edges sit in clang-fatal files, which libclang cannot adjudicate (precision .982 -> .976). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (5ef2a99) is not the one a maintainer labelled |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
PR #8377 @ 5ef2a99: 1 failed check(s) == callgraph (failure) -- real |
…bers as CI's libclang reads them (Part of #7828) CI sees 1539 clang edges on linuxdoom (local 1541) and 13 fatal files on doomgeneric (local 12), with the same disagreements; the gate runs on CI. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (faa7efb) is not the one a maintainer labelled |
|
No description provided. |
1 similar comment
|
No description provided. |
Part of #7828 (continues #8364).
What
c_macro_body_callsrecordedNone(a macro that links nothing) when one file defines a function-like macro twice with different callees, which is what an#if/#elseladder does. The engine does not evaluate#if, so the macro calls the union of its variants' callees when every variant calls something (as #8364 does for object-like aliases). A variant that calls nothing (linuxdoom#define SHORT(x) (x)beside theSwapSHORTone) keeps the macro ambiguous: libclang may build that variant. A signature macro staysNone; a macro two different files define differently stays ambiguous.Class / Sibling gaps
Class: a C call written through a preprocessor name does not link to the function the expansion calls. Members handled here: a function-like macro redefined under
#ifvariants in one file with different callees (the opensslOPENSSL_free/ERR_raise_datashapes are in the tests). Already handled earlier: object-like alias (#8364), single-body function-like macro (#6770).Sibling gaps (no burned estate needs any; C-only call-graph work):
.h.intemplate headers (opensslcrypto.h.in,err.h.in):.inis not inGalaxyScope._C_SOURCE_EXTS, so their macro bodies are not read. Not measured here (openssl is not a local corpus); may also be blocked in aperture. Needs a measurement on an openssl checkout.Evidence
call_graph_resolution.py c --ci(libclang 18.1.1, curl): confident precision 100.0%, recall 50.8 -> 51.0%, resolution recall 55.3 -> 55.4%, confident_judged 6756 -> 6781. Baseline regenerated.calls_out_to/ fan_in / fan_out / pagerank / graph_sqlite / llm_brief moved, from the added macro callees (e.g. godotERR_FAIL_COND_V_MSG's variants).call-graph-accuracy-auditred): the first version unioned a no-op variant too; libclang rejected those edges (c/cpp callee precision 97.7 -> 96.6 / 97.9 -> 96.3, linuxdoom 50 disagreements). Narrowed as above:call_graph_accuracy.py --cipasses, linuxdoom is back to 2 disagreements (precision .9968).--write-baseline) knowing that trade; the oracle unions one file's variants by the same rule. Goldens, C baseline (confident_judged6756, recall 50.8) re-blessed.test_macro_body_calls_6770.py(ladder union, empty variant, three-way ladder,OPENSSL_free/ERR_raise_datashapes, signature variant kept None, cross-file stays None),test_callgraph_oracle.py.audit_check.py: all clear.Lessons for agents
doom_rosetta_check.pyfails with largecallgraph_engine_onlyafter an engine macro change untilcallgraph_oracle.macro_body_calleesapplies the same rule; fix the oracle, don't bless.~/.cache/gitgalaxy/ruff-*glob entry is not the pinned ruff; usepr_gates --fastor read the pin.Cross-repo: none.
🤖 Generated with Claude Code