Repository navigation
C/C++ call-graph oracle: tree-sitter body oracle + family consensus, 20-port baseline (Part of #5630) - #5690
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ine (Part of #5630) tests/tools/doom_speedrun/callgraph_oracle.py checks calls_out_to on the licensed DOOM C/C++ ports two ways: a tree-sitter body oracle (misses by call shape, engine-only edges by how the callee appears: function-pointer / type / macro / comment-string / absent) with text and brace fallbacks for preprocessor misparses, and vanilla-family consensus. --only all, --write-baseline and --baseline --fail-on-regression are the hook for the DOOM-rosetta nightly (#5619). The baseline covers 20 ports at 4248895. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 20, 2026 03:07
This was referenced Oct 20, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #5630
What
tests/tools/doom_speedrun/callgraph_oracle.pyis a validation tool for C/C++calls_out_to. Until now these edges had no independent check: the Graph Accuracy Audit covers only Python, TypeScript and Java. It reads the scans thatdoom_speedrun.py scanleaves and runs on licensed ports only (theLICENSEDset refuses any other port). It is built from the doom-study prototypes (consensus.py, callcheck.py, cxx_cats2.py).function_definitionat its start line. Everycall_expressionwhose callee the port defines counts as an oracle call.unparsed.new T,T x(...)), macro, comment/string, absent.#ifdef-splitelse ifis read by a text fallback;ERRORnode.--only all --baseline tests/tools/doom_speedrun/callgraph_baseline.json --fail-on-regressionexits 1 in any of these cases:Baseline (engine 4248895, 20 licensed C/C++ ports)
Family consensus (9 vanilla-lineage ports, quorum 75%): holes 321, engine missed 2 (crispy-doom 1, inter-doom 1; shape function-pointer 2), real divergence 319, false-edge suspects 0.
The run takes about 60 s over all 20 ports. Three back-to-back runs gave byte-identical output.
Class sweep
The class is C/C++ call edges with no independent reference. Findings at 4248895:
R_PointToAngle -> SlopeDivin crispy-doom, inter-doom (the 2 consensus engine misses)scanner.cpp:81 ~Scanner -> Scanner,scanner.h:66 ~ParserState -> ParserState, the same in gzdoomswitchfunctionp_spec.c:5788 P_ExecuteZDoomLineSpecial: enginelocis 1427, the span has 1786 non-blank lines, and every call after line ~7215 is missed (EV_Light*, P_SpawnProjectile, ...)IFVIRTUALPTRNAME/IFVMbodies,MOODYCAMEL_CONSTEXPR_IFnew T,T x(...)) emitted as a calltypecolumn)absentengine-only edgesSibling gaps
No burned-estate program needs any of these: the burned estates are COBOL/CICS, and none of these touch the mainframe proofs.
Remaining slices
scanthe baseline's ports, then the gate command.absent/unparsedbuckets in gzdoom, doom3-bfg, eternity and odamex. The text-fallback counts there (290 to 590 functions) are the oracle's own weak spot.Gates
pr_gates.py --fast: 6/6 pass, with CI ruff 0.16.10 and mypy 2.4.0.pr_gates.py --ratchets: 8/8 pass, including time.audit_check.py: ruff, dead-key and ast-accuracy pass. The selfscan venv's mypy reports 16 findings, all in files this PR does not touch. The CI mypy (pr_gatesaudits) passes.tests/tools/test_callgraph_oracle.py, synthetic sources only. They pass under plainpytestfrom/tmp.test_source_reads.pyandtest_doom_speedrun.pypass.Lessons for agents
node.start_point[0], nevernode.start_point.row. The attribute read on the temporaryPointcorrupts the heap. The crash surfaces later in an unrelated allocation (PyObject_MallocviaPyLong_FromVoidPtr) and disappears underPYTHONMALLOC=debug, so it looks like a flake. A/B on the same harness:.rowsegfaulted 3 of 3 runs,[0]passed 3 of 3. SwappingNode.textfor slicing, caching the parser and changing the decoder did not help.;closes thefunction_definitionbefore its real}, which silently drops calls. Check for anERRORnode and compare with brace matching.🤖 Generated with Claude Code