Skip to content

DOOM call-graph: triage the libclang clean-file disagreements, puredoom first (Part of #5630, slice 3) - #6769

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/5630-s3-clang-triage
Oct 27, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/5630-s3-clang-triage

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5630, slice 3 of 3 (after #6768). Docs only: the README of tests/tools/doom_speedrun/ gains a triage table of the libclang reference's clean-file disagreements (puredoom 61, nugget-doom 6, woof 6, inter-doom 3, doomretro 2), each read in source at scan 2ac09c8ae; and the stale "#if 0 counts on both sides" line is corrected.

Triage (puredoom 61 = 27 + 34)

shape side edges verdict
call in a disabled branch: #if 0 (13) or #if defined(I_NET_ENABLED), macro never defined (14, i_net.c) engine-only 27 engine defect: calls_out_to counts the dead branch
call made by a function-like macro body (Z_ChangeTag -> Z_ChangeTag2/I_Error/doom_*: 28; FTOM/MTOF/CXMTOF -> FixedMul: 6) clang-only 34 engine miss by design (no macro expansion); real call at run time
other ports: static inline function in a header (p_saveg.h, m_array.h: 14 edges, nugget-doom, woof, doomretro) engine-only 14 reference blind spot; the edges are in source
other ports: stbiw__sbgrow macro -> stbiw__sbgrowf (inter-doom) clang-only 3 same macro shape

Baseline (callgraph_baseline.json, clang section, as committed by #6768)

port clang edges agree recall precision fatal files clean-file disagreements
chocolate-doom 11166 11096 0.9937 0.9199 324 0
crispy-doom 12779 12723 0.9956 0.9125 356 0
doom-ascii 1846 1829 0.9908 0.936 81 0
doom-wasm 3673 3656 0.9954 0.9135 161 0
doomgeneric 1969 1958 0.9944 0.9218 92 0
doomretro 5321 5192 0.9758 0.7481 95 2
dsda-doom 9310 9163 0.9842 0.8661 246 0
fastdoom 2416 2388 0.9884 0.9648 120 0
inter-doom 12988 12826 0.9875 0.9489 282 3
linuxdoom 1512 1493 0.9874 0.9726 59 0
nugget-doom 8829 8292 0.9392 0.9185 213 6
prboom-plus 3997 3774 0.9442 0.8591 133 0
puredoom 1864 1830 0.9818 0.9812 3 61
sdl-doom 1910 1899 0.9942 0.9259 82 0
woof 7998 7485 0.9359 0.9136 212 6

Class / Sibling gaps

Class: clean-file disagreements between the engine's calls_out_to and the libclang reference on the C ports; all 78 members classified above (the 10 other ports have none). Nothing in this PR changes the engine, so no golden moves. Sibling gaps (for the orchestrator to file):

  • Dead preprocessor branches in calls_out_to (#if 0, #if defined(X) with X never defined): 27 engine-only edges on puredoom (e.g. D_DoomLoop -> I_InitGraphics, R_StoreWallRange -> FixedDiv, i_net.c). Different mechanism from Dead C preprocessor branches (#if 0) are counted at file and function level; the macro shield only serves brace matching #2814 (closed; file/function signals): the call lists still read the dead text. Source: puredoom src/DOOM/d_main.c:305-385, r_segs.c:418-431, i_net.c:280.
  • Calls made inside a function-like macro's body are attributed to no caller: 37 clang-only edges (puredoom Z_ChangeTag and FTOM/MTOF, inter-doom stbiw__sbgrow). Needs a decision (expand at the use site, or accept as a by-design limit); not fixable by a regex tweak alone.
  • Reference gap, not engine: libclang reference lists no edges for static inline functions defined in a header (nugget-doom/woof p_saveg.h, doomretro m_array.h: 14 edges); candidate for clang_callgraph.py.

Evidence / gates

doom_clang_calls.py --sha 2ac09c8ae reproduced the committed numbers (puredoom 61; the other four as listed). The scan is from 2ac09c8, not HEAD (HEAD adds only the #6767 def/function/include rule, which none of these edges touch). test_callgraph_oracle.py 56 passed; test_change_classifier, test_sweep_plan, test_source_reads 132 passed. pr_gates --fast/--ratchets not run: README-only change (skipped, not passed). Remaining slices: none for triage; fixes are the sibling gaps.

🤖 Generated with Claude Code

…reference (Part of #5630, slice 3)

Classifies puredoom's 61 (and the other ports' 17) by shape in the doom_speedrun README.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@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 06:58
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 27, 2026 06:58
@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.

@squid-shepherd
squid-shepherd Bot merged commit 0c426cb into main Oct 27, 2026
62 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/5630-s3-clang-triage branch October 27, 2026 07:03
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