Repository navigation
DOOM-rosetta callgraph oracle: a bare macro misparsed as a definition named if no longer swallows the file (Part of #6266) - #6645
Merged
Conversation
…med `if` no longer swallows the file (Part of #6266) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the oracle fix (Part of #6266) srb2 misses 1358 -> 2, scored engine-only 640 -> 21; doom3-bfg misses 19 -> 3; edge-classic 38 -> 4; doomsday 1713 -> 1567. No engine change: the oracle stopped matching a bare-macro `if` misparse. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ged engine (Part of #6266) doom3-bfg / doomsday: #6639's function names plus this branch's oracle numbers. gzdoom: #6639's class-template member names in vectors.h / weightedlist.h (#6639 did not re-bless gzdoom); rescan confirmed stable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3 of 5 tasks
Contributor
|
No description provided. |
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 #6266 (Track D: finish the DOOM call-graph study).
What changed
The largest scored shape class was an oracle bug, not an engine one. A bare macro statement with no semicolon (srb2's
NOHUD/INLEVEL/NOSPAWNNULL) followed byif (...)parses in tree-sitter as a K&Rfunction_definitionnamedif, and its head can run to the end of the file. That had two effects:lua_baselib.c:955 lib_pInsideANonSolidFFloorproduced 479 "unparsed" misses.definition_atmatched later functions to the bogus node. That produced 879 "statement" misses and ~617 false "absent" engine-only edges, e.g.lib_gAddGametype -> luaL_error. The engine is right on all of them.tests/tools/doom_speedrun/callgraph_oracle.py:definition_atnever returns a definition whose name is a C keyword (_keyword_named).broken.DE_PIMPL(X) { methods }macro class, whose method calls belong to the methods. Without that exception doomsday misses rose by 1734. The same rule fixes the MSVC__asmearly close (doom3-bfg win_cpu.cpp:134 HasCPUID) and edge-classic'sEDGE_QSORT(...)run-over (r_image.cc:1087 GetUserSprites).Moves (goldens re-blessed with
doom_rosetta_check.py --update --yesundergolden-lock.sh;callgraph_baseline.jsonregenerated over all 23 licensed C/C++ ports):The 16 vanilla-lineage / Boom-family ports only gain a few text-fallback functions (calls unchanged), and the consensus is unchanged (holes 321, engine missed 2). No port reaches 0/0, so
manifest.csvexpected_fails is unchanged. The 9 newly scored rows the fix exposes are text-fallback noise on two ports (srb2RecordExceptionInfo -> __except, doomsday initializer-listnew Impl) or real calls the engine misses (doomsdayapp.cpp:1039 changeGame -> currentGameChanged).The merge of main also re-blesses gzdoom for #6639: two template-header function-name hashes (
TWeightedList<T>::AddEntry,vectors.h). #6639 re-blessed doom3-bfg and doomsday but not gzdoom; a second rescan confirmed it is stable.Step 1 and Step 2
The per-shape breakdown of all 9 ports is posted on #6266 as one comment: #6266 (comment). melek's #3784 / #6454 moved no port: all 11 ports matched their goldens at
f958d5a64. #6639 merged during this run and moved only function names, not callgraph numbers.The three "regressions" are not regressions, so there was nothing to bisect:
functionshave been expected_fails since the ports were added (the ctags convention ruling, cssdoom functions: bound-arrow count above ctags ruled a counting convention (Part of #5876) #5963 / sqldoom functions: bound-arrow and handler count above ctags ruled a counting convention (Part of #5876) #5966).callgraphhas failed since DOOM-rosetta: tree-sitter call-graph oracle covers kotlin; kocoa-doom scored (Part of #5874) #6422 first scored Kotlin (14 trailing-lambda-only calls,ifKey { ... }).Owner decisions
Owner OK (2026-10-25): Track D as above; copy this line into the PR body under
## Owner decisions.Checklist
Checklist: done [c:a1f0d74e]
Checklist: partial [c:9e7fe6a3] -- the bare-macro
ifmisparse class (oracle) is fixed; the engine classes listed under Remaining slices are leftChecklist: partial [c:0254d813] -- callgraph is still expected_fail on all 9 ports (srb2 now 2 misses / 21 scored engine-only); the nightly is unchanged
Checklist: partial [c:84996f5e] -- no port changed PERFECT status in this PR
Class / Sibling gaps
Class: a statement tree-sitter misparses as a function definition, whose node runs past the real function's braces, so the oracle credits the wrong calls to the outer function and to every later function. Siblings by misparse trigger:
if(keyword-named): fixed (srb2, plus the synthetic test).EDGE_QSORT(const Image *, ...)): fixed by the earlier-braces rule, edge-classic.__asm { }: fixed, doom3-bfg.DE_PIMPL/DE_GUI_PIMPL/DE_PIMPL_NOREF/DE_OBSERVES): deliberately left on the node. 1085 doomsday misses still sit in them, and those are ENGINE-side (it reads the macro class as one function).__try/__except: open (srb2win_dbg.c:384, 2 rows).Remaining slices
ENGINE classes, all measured in the #6266 comment:
DE_PIMPLmacro classes (1085 misses).XIConstantEffect -> XIBaseEffect,FStringCVar -> FBaseCVar,idGameError -> idException);gltextureunit.h:53 Unmanaged -> filter);OpenALSoundStream -> Source).IFVIRTUALPTRNAME->VMCall84 + 26; eternityMOODYCAMEL_CONSTEXPR_IF; odamexAGOBJECT_FOREACH_CHILD).wi_interlevel.cpp26 misses).Gates
pr_gates.py --fast7/7 and--ratchets9/9, both run viaheavy-run.sh.tests/tools/: pass.test_callgraph_oracle.pypasses (14 tests, 0.22 s, run via plainpytestfrom/tmp).git merge-treeagainst origin/main: clean.Lessons for agents
doom_speedrun.py scankeys scans by HEAD sha: a WIP commit mid-run splits the scans across two dirs. With nogitgalaxy/diff between the two shas, symlink one set into the other and pass--shatocallgraph_oracle.py.🤖 Generated with Claude Code