engine: pin the SVG a basic tikzpicture renders (tests, gated on GOTEX_PGF) - #192
Merged
Conversation
…X_PGF) The gobble tests (tikzgobble_test.go) prove that WITHOUT GOTEX_PGF a picture is stood in for and its body never leaks. Their counterpart — that WITH the real pgf/TikZ sources the same primitives reach the page as vector paths — had a single assertion (the diagonal of tikzsingle_test.go). This adds focused regression coverage for the primitives a basic picture is built from, each in exact big-point geometry through the engine's own system-layer driver (texmf/pgfsys-gotex.def): - a straight \draw line -> one open <path>, fill="none" - a \draw ... rectangle -> a closed path with the four corners + Z - a \fill[red] shape -> a colour scope + a path drawn stroke="none" - \draw[thick,blue] -> stroke-width / stroke colour scopes - a node's text -> glyph outline paths pgf's own sources are not embedded (a host supplies them on GOTEX_TEXMF), so like the other rendering tests these skip when that tree is absent; point GOTEX_TEXMF at a flattened pgf tree to run them. Test-only: no production or driver code changes, so output with the flag off is byte-identical to before (verified by cmp on arXiv 2212.13760 and 2304.01407). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds
tikzrender_test.go: focused regression tests pinning the SVG that a basic tikzpicture renders through the real pgf/TikZ sources and the engine's own system-layer driver (texmf/pgfsys-gotex.def).These are the counterpart of the gobble tests (
tikzgobble_test.go), which prove that withoutGOTEX_PGFa picture is stood in for and its body never leaks. The with-sources direction — the same primitives reaching the page as vector paths — previously had a single assertion (the diagonal intikzsingle_test.go). This covers the primitives a basic picture is built from, each in exact big-point geometry (TikZ works in cm; pgf converts itself, so 1cm = 28.45274bp, 2cm = 56.90549bp):\drawline<path>,fill="none"\draw ... rectangleZ\fill[red]shapestroke="none"\draw[thick,blue]stroke-width/ stroke-colour scopesWhy test-only
Verification against current
mainshowed the basic-through-intermediate render path is already comprehensive (lines, rectangles, circles, fills, colours, line width, dashes, arrows, node text all render). The gap was not the driver but its coverage: only one geometry assertion existed for the whole real-render path. This locks the contract in for the four primitives a basic picture uses.Gating / safety
pgf's own sources are not embedded — a host supplies them on
GOTEX_TEXMF— so like the existing rendering tests these skip when that tree is absent (CI stays green). PointGOTEX_TEXMFat a flattened pgf tree to run them.No production or driver code changes, so output with
GOTEX_PGFoff is byte-identical to before (verified:main-built vs branch-built binary produce identical flag-off SVG on arXiv 2212.13760 and 2304.01407). Full suite green; the 5 new tests pass against a real pgf tree and skip without one.🤖 Generated with Claude Code