Skip to content

calls_out_to: expand function-like macro bodies at the use site (Part of #6770) - #6881

Merged
squid-shepherd[bot] merged 7 commits into
mainfrom
churn/6770-macro-body-calls
Oct 28, 2026
Merged

squid-shepherd[bot] merged 7 commits into
mainfrom
churn/6770-macro-body-calls

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #6770, checklist item [c:9ca17251]: macro-body calls attributed to no caller (puredoom 34, inter-doom stbiw__sbgrow 3). Decision: expand at use site.

What changed

Why the goldens moved

Only Calls Out To entries gain callees a macro expands to (e.g. sqlite lemon.c: lemonStrlen -> strlen, ISUPPER -> isupper). No other section changed. DOOM-rosetta drift is only callgraph_* summary fields (callgraph_unscored grows by the macro edges; doomsday's check-7 numbers move in the 4th decimal).

Facts checked

  • Clang clean-file disagreements: puredoom 34 -> 0, inter-doom 3 -> 0 (callgraph_oracle.py --clang); nugget-doom 6, woof 6, doomretro 2 unchanged (header static inline blind spot, not this class).
  • Consensus after merging main (DOOM call-graph oracle: drop calls in literal dead preprocessor branches (Part of #6266) #6877): engine missed 3, suspects 0. The DOOM scan, oracle baseline and rosetta goldens were regenerated at the merged HEAD.
  • Baseline clang precision fell for dsda-doom, fastdoom, nugget-doom, prboom-plus, woof (0.3 to 3.3 points): the engine now lists macro-expanded edges clang cannot confirm in fatal-error files. The exact metric (clean files) did not move for them. Baseline regenerated for that reason.
  • Gates: pr_gates.py --fast 9/9 (re-run after the merge), --ratchets 9 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:

  • Object-like macros that expand to a call (#define F foo() style, no parameter list): not in the table.
  • doomsday (C++): body-oracle absent engine-only edges rose 42 -> 63 and type 2009 -> 2037 (C++ macros that expand to a constructor such as LOG_* -> de::LogEntryStager(...), or a name the oracle table does not reach). Needs a read of those 21 edges against source.
  • static inline functions defined in headers are a clang reference blind spot ([c:93af939e]): nugget-doom, woof (p_saveg.h), doomretro (m_array.h).
  • A split clang gate (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.
  • Clang gate split for unverifiable macro edges (above).
  • doomsday C++ residual (above).

Checklist: done [c:9ca17251]

Lessons for agents

  • callgraph_oracle.py --clang --write-baseline must be run after the engine change, through heavy-run.sh; the oracle reads scans keyed by engine SHA, so pass --sha <engine commit> when only tests changed since the scan.
  • A macro table unioned across files creates false "engine missed" hits on forks with per-game macros (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 aedeecc while the rescue was running. The follow-up commits f7b5bcb59, 5d1ee9f44 and 24511270c were pushed to churn/6770-macro-body-calls after the merge and are not on main. They add nested-macro expansion (a macro name such as SupportsLinux or OUTPUT is no longer listed as a callee) and refresh tests/call_graph_accuracy_baseline.json. The rescue opens no second PR; landing them is left to the owner.

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 28, 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 28, 2026 11:59
@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
squid-shepherd Bot enabled auto-merge (squash) October 28, 2026 12:05
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 28, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (aedeecc) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then).

@squid-shepherd
squid-shepherd Bot disabled auto-merge October 28, 2026 12:10
@squid-shepherd squid-shepherd Bot added the shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md label Oct 28, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Oct 28, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 28, 2026 12:18
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #6881 @ aedeecc: 1 failed check(s)

== call-graph-accuracy-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40685502191/job/122807299513
repro: python tests/tools/pr_gates.py --fast
errors:
2026-10-28 12:13:24,041 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
##[error]Process completed with exit code 1.
log tail:
lua FP: [('f', 3), ('assert', 2), ('write', 2), ('format', 1), ('f2', 1), ('x', 1), ('add', 1), ('012345678901234567890123456789012345678901234567890123456789', 1)]
FN: [('collectgarbage', 6), ('assert', 3), ('error', 2), ('dummy', 1), ('print', 1), ('getlocal', 1), ('f', 1), ('exit', 1)]
zig FP: [('volatile', 10), ('intCast', 5), ('get', 4), ('assert', 4), ('parseInt', 3), ('tagName', 3), ('as', 3), ('resolveType', 3)]
FN: [('import', 62), ('await', 9), ('ensureUnusedCapacity', 2), ('slice', 2), ('tagName', 2), ('field', 2), ('assert', 2), ('header', 2)]
dart FP: [('identical', 6), ('StatefulElement', 3), ('
', 2), ('constructor', 2), ('ScrollEndNotification', 1), ('ScrollNotification', 1), ('ScrollStartNotification', 1), ('MapEntry', 1)]
FN: [('objectRuntimeType', 8), ('describeIdentity', 4), ('debugGetCreatorChain', 3), ('toStringShort', 2), ('join', 1), ('contains', 1), ('_stringify', 1), ('shortHash', 1)]
haskell FP: [('Just', 6), ('null', 4), ('map', 4), ('Para', 4), ('break', 3), ('Str', 3), ('go', 3), ('maybe', 2)]
FN: [('Str', 4), ('String', 3), ('Just', 2), ('intercalate', 2), ('PandocShouldNeverHappenError', 1), ('runIO', 1), ('writeFile', 1), ('encodeLogMessages', 1)]
perl FP: [('undef', 154), ('grep', 16), ('map', 6), ('x', 6), ('E', 5), ('ord', 4), ('G', 3), ('Group', 3)]
FN: [('new', 12), ('print', 9), ('-f', 5), ('join', 5), ('name', 4), ('say', 4), ('warn', 4), ('-d', 4)]
solidity FP: [('address', 10), ('bytes32', 4), ('add', 3), ('mload', 3), ('gas', 3), ('bytes', 3), ('GovernorDisabledDeposit', 3), ('onlyRole', 2)]
FN: [('call', 2), ('require', 1)]
apex FP: [('COUNT', 6), ('runAs', 4), ('SUM', 1), ('AND', 1)]
FN: [('List', 4), ('Map', 3)]
powershell FP: [('Name', 6), ('Url', 6), ('PSModuleRestore', 4), ('Configuration', 4), ('Output', 4), ('ForMinimalSize', 4), ('Runtime', 4), ('Ignored', 4)]
FN: [('Join-Path', 127), ('Test-Path', 121), ('Get-Content', 57), ('ForEach-Object', 55), ('Split-Path', 44), ('new', 44), ('Where-Object', 36), ('Select-Object', 32)]
tcl FP: [('set', 218), ('expr', 41), ('regexp', 26), ('msgcat::mc', 17), ('registry::entry', 16), ('variants', 13), ('lappend', 7), ('revision', 7)]
FN: [('return', 176), ('variable', 58), ('mc', 35), ('for', 24), ('format', 17), ('error', 16), ('entry', 15), ('switch', 14)]
call_graph_accuracy: REGRESSION
c: precision_pct 99.4 -> 97.4
c: recall_pct 99.3 -> 96.4
cpp: recall_pct 99.0 -> 97.6
tcl: recall_pct 71.2 -> 69.3
##[error]Process completed with exit code 1.
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/e27c1028-1682-4c48-8c86-7d8e2aae1705' 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/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 28, 2026
import pytest

from gitgalaxy.core import detector as det
from gitgalaxy.standards.language_standards import LANGUAGE_DEFINITIONS
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

squid-shepherd Bot pushed a commit that referenced this pull request Oct 28, 2026
squid-protocol added a commit that referenced this pull request Oct 28, 2026
, 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]>
squid-protocol added a commit that referenced this pull request Oct 28, 2026
…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]>
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 shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants