Skip to content

C++ IFVM/IFVIRTUAL* macro blocks are statements, not functions; re-bless DOOM-rosetta (Part of #5630) - #6760

Merged
squid-shepherd[bot] merged 5 commits into
mainfrom
churn/5630-20261027T0022Z
Oct 27, 2026
Merged

squid-shepherd[bot] merged 5 commits into
mainfrom
churn/5630-20261027T0022Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #5630 (slice 2 of 4: gzdoom miss:statement).

What

gzdoom's scripting-call macros IFVM, IFVIRTUAL, IFVIRTUALPTR, IFVIRTUALPTRNAME, IFOVERRIDENVIRTUALPTRNAME (vm.h) open a block like if (IFVIRTUALPTRNAME(act, "Cls", Fn) { VMCall(func, ..); }). The C++ func_start rule read each as a function named for the macro (210 of them in gzdoom), so the enclosing function lost the block's calls (VMCall, IntAt, Destroy, ...): 84 oracle miss:statement edges.

  • cpp.py: the "not a function" shield now excludes these macro names (whole identifier only; IFVMx, IFVIRTUALS stay functions).
  • callgraph_oracle.py: tree-sitter also reads the block as a nested definition, so MACRO_STATEMENT (added for DE_* in C++ DE_FOR_EACH*/DE_FOR_OBSERVERS/DE_NOTIFY* macro statements are not functions; re-bless DOOM-rosetta (Part of #5630) #6756) now covers them, otherwise the oracle credited the calls to a nested function and scored them engine-only absent (19 -> 280 before the oracle change).
  • Tests: test_cpp_vm_call_macro_5630.py (5 macros + negative; 5 of 6 fail without the fix), test_callgraph_oracle.py.

Measured (gzdoom, scans at the PR head)

before after
miss:statement 84 16
misses, all shapes 120 26
recall .9972 .9994
precision .9659 .9656
engine-only type 1277 1303
Precision dips .0003: 26 more engine-only type edges (unscored kind) from the functions that now keep the block's constructor-style calls. Every other port's baseline numbers are unchanged; consensus unchanged (holes 321, engine missed 2).

File-cap exception: 4 hand-written files (cpp.py, the new test, callgraph_oracle.py, test_callgraph_oracle.py); the other 4 flagged files are regenerated tests/golden_doom_rosetta/*.json.gz goldens (blessed by doom_rosetta_check.py --update --yes, never hand-edited).

Gates

  • pr_gates.py --fast 9/9; --ratchets 9 pass / 0 fail / 0 skipped (before the main merge; merged main only for a conflict in doomsday.json.gz, re-blessed).
  • crucible_check.py --update --yes (golden-lock, both legs): no drift (the language-crucible has none of these macros).
  • doom_rosetta_check.py --update --yes: gzdoom 47 changes (38 file, summary), odamex 2, doom3-bfg 1, doomsday 3 (callgraph summary only, plus the macro functions gone); after the main merge only doomsday re-moved (2 summary).
  • Tree-wide guards + test_callgraph_oracle.py + new test: 315 passed. callgraph_baseline.json regenerated (gzdoom counts, engine_sha).

Class / Sibling gaps

Class: a C++ statement macro that takes a block, read by the engine as a function and so stealing its body's calls from the caller. Handled here: the five gzdoom VM-call macros (all that vm.h defines; each has a test case). Checked: the other all-caps "functions" in the gzdoom scan are DEFINE_ACTION_FUNCTION* (real definitions) and expression macros (RGB, MTOF...), not block statements.
Remaining gzdoom miss:statement (16, a different mechanism, no engine change in this PR):

  • Explicit destructor calls x.~Node(), ~FString, ~player_t (13): the engine does not record a destructor call as a call to the class's destructor; needs a decision on the credited name (~X vs X::~X).
  • Printf in pngtexture.cpp (1), ~VMFunction in vm.h (1), ~DrawerCommand in r_thread.cpp (1): same destructor-call family or per-edge reading.
  • Other macro-block candidates in gzdoom the oracle does not flag today: STRINGBUILDER_START/FINISH (1 each).

Remaining slices

  1. doomsday class-head absent edges (read first, engine or oracle). 3. libclang C-subset reference. 4. gzdoom explicit-destructor-call edges (above).

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 27, 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 27, 2026 01:13
@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 27, 2026 01:16
@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 27, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant