Skip to content

C++ DE_FOR_EACH*/DE_FOR_OBSERVERS/DE_NOTIFY* macro statements are not functions; re-bless DOOM-rosetta (Part of #5630) - #6756

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/5630-20261026T2250Z
Oct 26, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/5630-20261026T2250Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #5630 (slice 3).

doomsday's DE_FOR_EACH*(T, i, c), DE_FOR_OBSERVERS(i, a) and DE_NOTIFY*(Name, i) take a body like for. func_start read each as a function named for the macro, so the enclosing function lost the body's calls. A name shield (cpp.py, item 5 of func_start) now refuses them; the body stays in the caller. The call-graph oracle read the same macro as a tree-sitter nested definition and credited the calls to it, so it now treats it as a statement of its function (MACRO_STATEMENT).

Class / Sibling gaps

Class: C++ macro-statement loops/dispatch that take a body, in the doomsday vocabulary found in the corpus (counted over all DOOM ports).

Member Occurrences Status
DE_FOR_EACH, DE_FOR_EACH_CONST 32 / 63 fixed, tested
DE_FOR_EACH_REVERSE, DE_FOR_EACH_CONST_REVERSE 1 / 2 fixed, tested
DE_FOR_OBSERVERS 28 fixed, tested
DE_NOTIFY, DE_NOTIFY_VAR 146 / 33 fixed, tested
DE_NOTIFY_PUBLIC, DE_NOTIFY_PUBLIC_VAR 100 / 12 fixed, tested
AGOBJECT_FOREACH_CHILD (1 hit, another project's macro) 1 sibling gap: a vendor-agnostic rule for ALL-CAPS *FOREACH* statement macros needs a different mechanism (risk of hiding real macro-defined functions)
pngtexture.cpp case MAKE_ID('..'): labels read as functions n/a sibling gap: case-label shape, different rule

Remaining slices: other macro-statement vocabularies (non-DE_) as the corpus shows them.

Evidence

  • doomsday call-graph oracle, same scan, before -> after: recall .9948 -> .9979, precision .9650 -> .9653, misses by shape statement 103 -> 14, nested-argument 48 -> 10, after-operator 39 -> 14. Control = this engine without the cpp.py change reproduces the committed baseline exactly. Only doomsday moved in callgraph_baseline.json.
  • Crucible goldens (crucible_check.py, both legs): zero diff, nothing to bless. pr_gates --fast 9/9, --ratchets 9/9 (0 skipped).
  • Oracle test (test_callgraph_oracle.py) and new test_cpp_macro_statement_loop_5630.py (10 macro forms plus a DE_NOTIFYfoo still-a-function guard).

DOOM-rosetta re-bless

tests/golden_doom_rosetta/ was never re-blessed after #6754 (DOOM-rosetta run 40411624531 red). doom_rosetta_check.py --update --yes rewrote edge-classic, odamex, gzdoom, eternity and doomsday. The func_hash drift on edge-classic, odamex, gzdoom and eternity is pre-existing, #6754's (not separated by a control run; those ports hold no DE_ macros). doomsday's 247 file changes are this change's.

File-cap exception: the 5 tests/golden_doom_rosetta/*.json.gz files are regenerated by doom_rosetta_check.py --update --yes (the owner-requested re-bless), not hand-written; the 4 hand-written files are below the cap.

Hand-written files: 4 (cpp.py, callgraph_oracle.py, two tests). Goldens and the baseline are regenerated.

🤖 Generated with Claude Code

… functions; re-bless DOOM-rosetta (Part of #5630)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 26, 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 26, 2026 23:32
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 26, 2026 23:36
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #6756 @ b048c23: 1 failed check(s)

== shard 1 (1669449 LOC) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40420489506/job/121913504577
repro: python tests/tools/pr_gates.py --fast
failing tests: tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[doomsday]
errors:
E AssertionError:
tests/doom_rosetta/test_doom_rosetta.py:47: AssertionError
FAILED tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[doomsday] - AssertionError:
##[error]Process completed with exit code 1.
log tail:
doomsday: 3 difference(s) from the golden
summary.callgraph_engine_only: 480 -> 234
summary.callgraph_precision: 0.9618 -> 0.9653
summary.callgraph_unscored: 2246 -> 2243
(bless an intended change with tests/tools/doom_rosetta_check.py --update --yes)
assert not 'doomsday: 3 difference(s) from the golden\n summary.callgraph_engine_only: 480 -> 234\n summary.callgraph_precision: 0.9618 -> 0.9653\n summary.callgraph_unscored: 2246 -> 2243'
1 failed, 9 passed, 26 deselected in 205.40s (0:03:25)
##[error]Process completed with exit code 1.
##[group]Run s=$(( $(date +%s) - T0 ))
s=$(( $(date +%s) - T0 ))
echo "shard 1 (1669449 LOC): ${s}s" >> "$GITHUB_STEP_SUMMARY"
shell: /usr/bin/bash -e {0}
env:
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
DOOM_SPEEDRUN_WORK: /home/runner/work/gitgalaxy/gitgalaxy/../doom-work
DOOM_ROSETTA_PORTS: chocolate-doom,cssdoom,dartdoom,doomgeneric,doomsday,edge-classic,mood,room4doom,rust-doom,sdl-doom
T0: 1793057599
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/88f35948-128a-402d-abcf-8cf7657a43d4' 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 26, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 5a0e497 into main Oct 26, 2026
128 of 129 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/5630-20261026T2250Z branch October 26, 2026 23:42
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.

1 participant