Repository navigation
calls_out_to: expand function-like macro bodies at the use site (Part of #6770) - #6881
Conversation
…te (#6770) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…churn/6770-macro-body-calls
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ansion (#6770) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ain (#6770) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
CI shepherd: the head of this PR (aedeecc) is not the one a maintainer labelled |
|
No description provided. |
|
PR #6881 @ aedeecc: 1 failed check(s) == call-graph-accuracy-audit (failure) -- real |
| import pytest | ||
|
|
||
| from gitgalaxy.core import detector as det | ||
| from gitgalaxy.standards.language_standards import LANGUAGE_DEFINITIONS |
|
No description provided. |
…6770) (#6906) Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
, re-bless 4 DOOM goldens after #6899 (#6908) * Refresh the call-graph accuracy baseline for c, cpp, tcl after #6864/#6870/#6881 Per-commit runs on the pinned crucible (v1.7.0) attribute every drop: - #6864 (tcl switch arms): tcl recall 71.2 -> 69.3 - #6870 (dead preprocessor branches): c recall 99.3 -> 96.4, cpp recall 99.0 -> 97.6; the new misses are calls behind toggles never defined in the tree (Py_GIL_DISABLED, Py_REF_DEBUG, MZ_USE_JIT, MICROPY_GC_SPLIT_HEAP) that tree-sitter still counts - #6881 (macro bodies expanded at the use site): c precision 99.4 -> 97.4, cpp 98.2 -> 97.8; tree-sitter cannot see calls inside macro bodies None of the three refreshed the baseline, so the gate failed on every engine PR since. Only c, cpp and tcl change; other languages untouched. Part of #6770 Co-Authored-By: Claude Opus 5.5 <[email protected]> * DOOM-rosetta: re-bless odamex, gzdoom, fastdoom, srb2 after #6899 #6899 merged with these four goldens drifted (its own DOOM-rosetta run 40715491522 failed on them). Only summary.callgraph_unscored moves, plus callgraph_precision in the fourth decimal on three ports: odamex precision 0.983 -> 0.9829, unscored 576 -> 578 gzdoom precision 0.9662 -> 0.9663, unscored 3894 -> 3889 fastdoom precision 0.9993 -> 0.9997, unscored 87 -> 86 srb2 unscored 2531 -> 2530 No expected_fails change. A local check on main reproduced CI's drift exactly. Part of #6266 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…uto-merge off (#6919) (#6920) * CI shepherd: ci-gate commit status on every open PR, and a red check turns auto-merge off (#6919) Path-filtered workflows ran but never gated a merge: the ruleset requires five core checks, and the shepherd only labelled other failures needs-fix while auto-merge stayed on. #6881, #6894, #6895 and #6899 merged with DOOM-rosetta / call-graph-accuracy red. - decide(): triage runs before the auto-merge decision; a real failure of any gating check (not the shepherd's own jobs, not ADVISORY) blocks and turns auto-merge off. - gate_status(): ci-gate is pending (draft, running or rerun checks, main's failure, an unreported required check), failure (a real failure) or success; posted only on change, and the shepherd's own status is never read back as an input. - reconcile covers every open PR (open_prs), so a hand merge is gated too; it also triggers on DOOM-rosetta and Call Graph Accuracy Audit (GATE_TRIGGERS). - pr_check / graphql_reads fetch the status description, so an unchanged gate is not reposted. The ruleset change (require ci-gate) is the owner's step after a soak. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test_shepherd_gh: reconcile exit-code tests fake open_prs, not open_labelled (#6919) reconcile now lists every open PR through open_prs; the two exit-code tests still faked open_labelled, so they reached a real `gh api pulls?state=open`. They passed where gh is logged in and failed in full-suite part 1/2 (no GH_TOKEN in CI). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvfVvURyJ9zRpgVkace --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Part of #6770, checklist item [c:9ca17251]: macro-body calls attributed to no caller (puredoom 34, inter-doom
stbiw__sbgrow3). Decision: expand at use site.What changed
calls_out_toof a C/C++/ObjC function now includes the callees of every function-like macro it invokes. A repo-wide table (macro name -> body callees) is built in the Orchestrator and handed to workers like the C/C++ macro-defined functions: name from the #define (repo-wide), keep the class qualifier (eternity CONSOLE_* 77/240 misnamed; gzdoom 78 cross-class name collisions) #5563 macro table and the calls_out_to: drop calls in dead preprocessor branches (#6770) #6870 unset-toggle table. Nesting goes to depth 4 and is cycle-safe. A macro defined differently in two files is skipped, and so are macros that expand to function signatures (C/C++ function-defining macros are not counted as functions (6,074 of 6,437 in the DOOM corpus: DEFINE_ACTION_FUNCTION, CCMD, FUNC(...)) #5461). Code:gitgalaxy/core/detector.py,gitgalaxy/galaxyscope.py,tests/core_engine/test_macro_body_calls_6770.py(18 tests).callgraph_oracle.py) is lexical, so it would call every such edge a false engine edge. It now builds the same macro table and classifies an engine edge reached through a macro asmacro-expansion(excluded from precision, reported asmacro_expansion_calls). 4 new tests intest_callgraph_oracle.py.golden_master_audit,golden_master_zero_dep_audit,golden_doom_rosetta,callgraph_baseline.json.Why the goldens moved
Only
Calls Out Toentries gain callees a macro expands to (e.g. sqlitelemon.c:lemonStrlen->strlen,ISUPPER->isupper). No other section changed. DOOM-rosetta drift is onlycallgraph_*summary fields (callgraph_unscoredgrows by the macro edges; doomsday's check-7 numbers move in the 4th decimal).Facts checked
callgraph_oracle.py --clang); nugget-doom 6, woof 6, doomretro 2 unchanged (headerstatic inlineblind spot, not this class).pr_gates.py --fast9/9 (re-run after the merge),--ratchets9 pass (before the merge), oracle + macro tests 99 passed.Class / Sibling gaps
Class: a call that exists only after preprocessor expansion. Fixed here: function-like macro bodies in the c/cpp/objc lanes. Not fixed:
#define F foo()style, no parameter list): not in the table.absentengine-only edges rose 42 -> 63 andtype2009 -> 2037 (C++ macros that expand to a constructor such asLOG_*->de::LogEntryStager(...), or a name the oracle table does not reach). Needs a read of those 21 edges against source.static inlinefunctions defined in headers are a clang reference blind spot ([c:93af939e]): nugget-doom, woof (p_saveg.h), doomretro (m_array.h).doom_clang_calls.py) that treats macro edges in fatal-error files as unverifiable would be a 6th hand-written file.Remaining slices
tests/tools/doom_speedrun/README.md: update the clean-file triage table (puredoom 34 -> 0, inter-doom 3 -> 0), the "is a clang-only lead" paragraph, and note the clang precision drop and the doomsday residual. Left out to stay within the 5-file cap.Checklist: done [c:9ca17251]
Lessons for agents
callgraph_oracle.py --clang --write-baselinemust be run after the engine change, throughheavy-run.sh; the oracle reads scans keyed by engine SHA, so pass--sha <engine commit>when only tests changed since the scan.FTOM/MTOF); drop macros defined differently per file, as the engine does.🤖 Generated with Claude Code
Rescue note (Opus, after merge): this PR merged at
aedeeccwhile the rescue was running. The follow-up commitsf7b5bcb59,5d1ee9f44and24511270cwere pushed tochurn/6770-macro-body-callsafter the merge and are not on main. They add nested-macro expansion (a macro name such asSupportsLinuxorOUTPUTis no longer listed as a callee) and refreshtests/call_graph_accuracy_baseline.json. The rescue opens no second PR; landing them is left to the owner.