GOTEX_TRACE: a runaway names the macro that loops - #358
Merged
Merged
Conversation
A runaway is the hardest failure this engine reports to act on. The error names
the line the document DIED on, which is almost never the line at fault: loading
pgf's parser module (\usepgfmodule{parser}, reached from \usetikzlibrary
{svg.path}) says "6:15" — the document's \end{document} — for a loop that starts
hundreds of expansions earlier, inside pgfkeys. Bisecting the 697-line module by
truncation answered nothing, because a half-read file breaks in its own way.
With GOTEX_TRACE set, tripRunaway prints two windows instead: the FIRST
expansions since the input last moved forward (where the loop begins, with its
caller) and the LAST ones (what it repeats). Runs are collapsed — "\pgfkeys@
mainstop x400" — so the caller is not pushed out of the report by the loop
itself. On the module above the answer was one line, and it named a pgfkeys
sentinel (\def\pgfkeys@mainstop{\pgfkeys@mainstop}, "equals only itself") being
EXPANDED where it should have been matched.
Off by default: the recorder does nothing and allocates nothing unless the
variable is set, and the report goes to traceOut (os.Stderr) so a test can read
it back.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 12, 2026
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.
A runaway is the hardest failure this engine reports to act on. The error names the line the document died on, which is almost never the line at fault: loading pgf's parser module (
\usepgfmodule{parser}, reached from\usetikzlibrary{svg.path}) reports6:15— the document's own\end{document}— for a loop that starts hundreds of expansions earlier, inside pgfkeys. Bisecting the 697-line module by truncation answered nothing, because a half-read file breaks in its own way.With
GOTEX_TRACEset,tripRunawayprints two windows instead:The first window is where the loop begins, with its caller still in view; the second is what it repeats. Runs are collapsed, so the loop cannot push the caller out of its own report. On the module above the answer was one line, and it named a pgfkeys sentinel —
\def\pgfkeys@mainstop{\pgfkeys@mainstop}, "equals only itself" — being expanded where it should have been matched as a delimiter.Off by default: nothing is recorded and nothing is allocated unless the variable is set. The report goes to
traceOut(os.Stderr) so a test can read it back, and both states are tested.🤖 Generated with Claude Code