Skip to content

DOOM call-graph: --clang folds the libclang reference into callgraph_baseline.json (Part of #5630, slice 2) - #6768

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

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/5630-20261027T0608Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #5630 (slice 2 of 3). Follows #6766.

What

callgraph_oracle.py --clang runs the libclang reference (doom_clang_calls.run_port) on the scanned C ports and folds it into the same run:

  • --write-baseline stores a clang section per port (clang_edges, engine_edges, agree, recall, precision, files_fatal, disagreements_in_clean_files); a run without --clang keeps the committed section.
  • --baseline fails when a port's clang recall or precision drops past --tolerance, a baselined port is missing, or disagreements_in_clean_files grows. Disagreements in fatal-error files are reported but never gated (they move with the missing headers, not the engine).
  • --clang with no libclang prints why and fails --fail-on-regression (a silent skip would un-gate the nightly).
  • doom-rosetta.yml nightly callgraph job: installs ci/requirements/callgraph.txt (libclang 18.1.1, same as local) and passes --clang; pull_request paths gain the two clang tool modules (test_workflow_paths_cover_the_check_imports); the pin table line in test_pipeline_pins.py moves 109 -> 110.
  • Include stub: not added. The clean-file count already separates the missing-header artefact, so the gate does not need one.

Needs the owner: this PR edits .github/workflows/doom-rosetta.yml (nightly --clang + libclang install + pull_request paths), which the churn queue item did not authorise. It cannot be dropped without turning test_workflow_paths_cover_the_check_imports red (the check lazily imports the clang modules), so the owner should approve the workflow edit or tell me to import them differently.

Evidence

Fresh scan at 2ac09c8ae of the 15 C ports; the non-clang oracle numbers equal the committed baseline for all 15 (no engine drift), so only the clang section was added (engine_sha and the rest untouched). Clean-file disagreements: puredoom 61, nugget-doom 6, woof 6, inter-doom 3, doomretro 2, the other 10 ports 0. Clang recall 0.936-0.996, precision 0.748-0.981 (fatal-error files dominate the gap). Unit tests: 56 passed in test_callgraph_oracle.py (+3 new: clang gate, baseline view, no-libclang skip). pr_gates --fast: 9/9. Not run: --ratchets (no engine, golden or ledger input changes) and the nightly itself (schedule/dispatch only).

Class / Sibling gaps

Class: C/C++ call-graph references gated against callgraph_baseline.json. Members: tree-sitter body oracle + consensus (gated before this PR); libclang on the 15 C ports (gated here); libclang on the C++ ports (doomsday, eternity, gzdoom, odamex, srb2, doom3-bfg, doom3do, edge-classic, ...): not covered, clang_callgraph.py reads C only. Sibling gaps: puredoom's 61 clean-file disagreements are unread leads (a real engine gap or a clang guess is not yet decided); the other-language ts_callgraph_oracle.py has no baseline gate here.

Remaining slices

Slice 3 (per the issue): triage and fix the clean-file disagreements, starting with puredoom, then tighten the baseline.

Cross-repo

None.

🤖 Generated with Claude Code

…baseline.json and the nightly gate (Part of #5630, slice 2)

callgraph_oracle.py --clang runs doom_clang_calls.run_port on the scanned C ports; the baseline gains a per-port
clang section (recall, precision, fatal-error file count, disagreements in clean files) and --baseline fails when
clang recall/precision drop or the clean-file disagreement count grows. The doom-rosetta nightly passes --clang and
installs the pinned libclang.

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


def run_clang(ports, work, sha):
"""The libclang reference over the C ports among ``ports`` that have a scan: ({port: result}, why-not or None)."""
import doom_clang_calls # lazy: it imports this module, and libclang is optional
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.

2 participants